The point is you're integrating around a small circle around the point $a$, not going through it, as in real analysis $\frac{1}{x^n}$ is differentiable away from 0 with antiderivative $\frac{1}{-(n-1)} \frac{1}{x^{n-1}}$ for $n > 1$.
Edit: let's recall how to compute a contour integral, over $\gamma$ with endpoints $z_0, z_1$ as in the picture. By definition, if $f = f_1 + i f_2$, where $f_1, f_2: \mathbb{C} \rightarrow \mathbb{R}$, then formally set $dz = dx + i dy$ and mash out: $\int_\gamma (f_1 + i f_2)(dx + i dy) = \int_\gamma f_1dx - f_2dy + i \int_\gamma f_1 dy + f_2 dx$So a complex contour is just 2 regular line integrals.
Now, I claim that because of this, we can import the following theorem from line integrals: if one is trying to integrate $P dx + Q dy$ over $\gamma$, now let's say $\gamma$ joins points $a$ and $b$, and in any neighborhood of the image of $\gamma$, we have some function $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ such that $\partial_x f = P, \partial_y f = Q$, then $\int_\gamma Pdx + Qdy = f(b) - f(a)$This is pretty much the fundamental theorem of calculus.
Since we saw a complex contour integral is just 2 line integrals, you might hope some form of this theorem can apply, and indeed, it does, suppose we have in any neighborhood of the image of $\gamma$ a holomorphic function $F$ satisfying $F'(z) = f(z)$, unwinding this and writing $F = F_1 + i F_2$, this means in real analysis terms that: $\partial_x F_1 = f_1 \quad \quad \partial_x F_2 = f_2$ Since the first column of the Jacobian shows where $(1,0)$ goes under the action of $dF$, i.e. multiplication by $f(z)$.
With that, our contour integral above is just $\int_\gamma f_1dx - f_2dy + i \int_\gamma f_1 dy + f_2 dx = \int_\gamma \partial_x F_1 dx - \partial_x F_2 dy + i \int_\gamma \partial_x F_1 dy + \partial_x F_2 dx$Now we use the Cauchy-Riemann equations, which just say that $dF$ looks like a scaled rotation matrix, since that's what multiplication by a complex number does, we get: $\int_\gamma \partial_x F_1 dx + \partial_y F_1 dy + i \int_\gamma \partial_y F_2 dy + \partial_x F_2 dy$Now this we can straight up apply our real analysis theorem about contour integrals to, we obtain $ = F_1(b) - F_1(a) + i(F_2(b) - F_2(a)) = F(b) - F(a)$
Anyways, long story short: we can salvage a version of FTC, and all it cares about is having a local antiderivative. Now, $\frac{1}{z^2}, \frac{1}{z^3}, \ldots$ all have antiderivatives on $\mathbb{C} - 0$, so everything is fine and dandy so long as $\gamma$ doesn't touch 0. In this case since $a = b$ the integral is just 0.
For $\frac{1}{z}$, the issue is that we don't have a well defined antiderivative on $\mathbb{C} - 0$. Indeed, the problem is with $\log z$. In the case of $\mathbb{R^{>0}} \rightarrow \mathbb{R}$, this is just the inverse to $e^x$. But now, $e^z$ isn't a bijection from $\mathbb{C} \rightarrow \mathbb{C} - 0$, but it nearly is: $e^z = e^{z'}$ iff $z - z'$ is an integral multiple of $2\pi i$. In that sense $\log$ will be "multivalued" - when you wind around the origin once, any choice of $\log$ will change by $2\pi i$, so you can't get a well-defined holomorphic log on all of $\mathbb{C} - 0$.