Let $\gamma:[\alpha,\beta] \to \mathbb C$ be a piecewise differentiable closed curve, which doesn't pass through the point $a$. Denote by $\Gamma$ the point set $\gamma([\alpha,\beta])=\{\gamma(t):\alpha \leq t \leq \beta \}$, and the points where $\gamma'$ fails to be continuous by $\alpha \leq t_1^* (only a finite number of these).
A continuous image of a compact space is compact, and therefore $\Gamma$ is compact. Also $a \notin \Gamma$, so there exists $\epsilon=\min_{z \in \Gamma} d(z,a)>0$.
In order for a single valued branch of $\arg (z-a)$ to exist on a subarc, we require that the maximal distance between any two points on the subarc is less than $2\epsilon$. (doing that forbids the subarc performing a complete circle - in fact even half a cycle is impossible that way).
The length of $\Gamma$,$L$ is finite, so there exists a natural number $M$ such that $\frac{L}{M} < 2\epsilon$
Set $P_0=\gamma(\alpha)$.
Having $P_n=\gamma(t_n)$ defined, we define the next point $P_{n+1}$ to be:
If there is a singular point $t_j^*$ ahead, and it is close enough (meaning $d(P_n,\gamma(t_j^*)) \leq 2\epsilon$) we choose $P_{n+1}=\gamma(t_j^*)$ where $t_j^*$ is the next singular point.
If there is a singular point $t_j^*$ ahead, and it is far away (meaning $d(P_n,\gamma(t_j^*)) > 2\epsilon$), we define $t_{n+1}$ according to $t_{n+1}=\sup \{t \in [t_n,t_j^*]:\int_{t_n}^t \| \gamma'(u) \| \mathrm{d}u \leq 2 \epsilon \}$, and $P_{n+1}=\gamma(t_{n+1})$
If there are no singular points ahead we define $t_{n+1}=\sup \{t \in [t_n,\beta]:\int_{t_n}^t \| \gamma'(u) \| \mathrm{d}u \leq 2 \epsilon \}$ and $P_{n+1}=\gamma(t_{n+1})$
You should convince yourself that it takes a finite number of iterations (at most the number of singular points + M) to get to the last point $\gamma(\beta)$. Moreover the subarc between any two consecutive points $P_n,P_{n+1}$ admits a single valued branch of $\arg(z-a)$.
Denote the subarcs above by $\gamma_1,\gamma_2,\dots,\gamma_K$. We have $\int_\gamma \frac{dz}{z-a}=\sum_{j=1}^K \int_{\gamma_j} \frac{dz}{z-a}$. In every subarc the single valued branch of the argument corresponds to an analytic branch of the logarithm. Thus:
$\int_{\gamma_j} \frac{dz}{z-a}=\int_{\gamma_j} \mathrm{d} \log(z-a)=\int_{\gamma_j} \mathrm{d} \ln |z-a|+i \int_{\gamma_j} \mathrm{d} \arg(z-a) $
When summing over all $j$, the real parts form a telescoping sum which adds up to zero. And the imaginary part is the sum of all angle increments, which is an integer multiple of $2\pi i$ (because we end up on the same ray from $a$ as we started with).