Lemma. Let $D$ be a compact connected region on a Riemann surface $M$, with $K\neq M$. There exists a domain $D$ on $M$ such that
$(1)$ $K\subset D$,
$(2)$ $\overline{D}$ (closure) is compact,
$(3)$ $\partial D$ consists of finitely many closed (as a set) analytic curves (i.e., holomorphic image of a straight line).
Proof. If $M$ is compact the lemma is trivial. Choose $P\notin K$ and a small disk $U$ about $P$ in $M\setminus K$. In the general case, every $P\in K$ is included in a conformal disc. Finitely many such discs will cover $K$. Let $D_1$ be the union of these discs. By changing the radii of the discs, if necessary, we may assume that the boundaries of the discs intersect locally only in pairs and non-tangentially. Delete from $D_1$ a small disc $U$ in $D_1\setminus K$ and call the resulting domain $D_2$. Solve the Dirichlet problem with boundary value $1$ on $\partial U$, $0$ on $\partial D_1$ (it's known that it's solvable). Let $D$ be the component containing $K$ of $$\{P\in D_2:u(P)>\epsilon>0\},$$ where $\epsilon<\min\{u(P):P\in K\}$. The critical points of the harmonic function $u$ (the points with $du = 0$) form a discrete set. By changing $\epsilon$ we eliminate them from $\partial D$. Thus, the domain satisfies $(1)-(3)$. $\square$
I think removing critical points is to ensure $D$ is open. But why $(3)$ is true? $D$ is just an open component containing $K$. We don't know about its boundary.