As said in the comments, Cauchy's theorem only applies to simply connected regions. For example, if you choose $U=\mathbb C\setminus \\{0\\}$, then $\frac1z$ is holomorphic in $U$, but $U$ is not simply connected.
If $U$ is simply connected and does not contain $0$, then you cannot find a path that winds around $0$, so you dont have to worry about contour integrals whose path winds around $0$.
Note that the evaluation of the "loop of the logarithm" can only be nonzero, if you wind around $0$ (at least) once.