Variant 1: Harmonic functions have the mean value property,
$$f(z) = \frac{1}{2\pi} \int_0^{2\pi} f(z + re^{i\varphi})\,d\varphi$$
if $f$ is harmonic in $\Omega$ and $\overline{D_r(z)} \subset \Omega$.
$u$ is an entire harmonic function, hence
$$u(0) = \frac{1}{2\pi}\int_0^{2\pi} u(e^{i\varphi})\,d\varphi = \frac{1}{2\pi}\int_0^{2\pi} \cos(\varphi)e^{\cos\varphi}\cos (\sin\varphi) - \sin(\varphi)e^{\cos\varphi}\sin(\sin\varphi)\,d\varphi.$$
Whether we write $z$ and $re^{i\varphi}$ or $(x,y)$ and $(r\cos \varphi, r\sin\varphi)$ is completely immaterial. The complex notation is just more convenient sometimes.
Variant 2: Consider the analytic function $f = u+iv$.
Since $u$ and $v$ are both real, and $d\varphi$ is also real, we have
$$\begin{align}
\int_0^{2\pi} u(\cos\varphi,\sin\varphi)\,d\varphi &= \operatorname{Re}\left(\int_0^{2\pi} u(\cos\varphi,\sin\varphi)\,d\varphi + i\int_0^{2\pi} v(\cos\varphi,\sin\varphi)\,d\varphi\right)\\
&= \operatorname{Re} \int_0^{2\pi} f(e^{i\varphi})\,d\varphi.
\end{align}$$
Now,
The path integral over some closed curve is zero, over an analytic function.
is not correct as stated. On the one hand, the closed curve must not wind around any point in the complement of the function's domain - but since we have an entire function, that is vacuously satisfied here. More pertinent in the case at hand is that the integral theorem concerns only integrals with respect to $dz$ (it's a theorem about holomorphic differential forms), but here the integrand is $f(z)\,d\varphi$, not $f(z)\,dz$. Thus Cauchy's integral theorem does not apply.
However, for integrals over a circle, we have a simple correspondence between $dz$ and $d\varphi$. If we parametrise the circle as $\gamma(\varphi) = z_0 + r e^{i\varphi}$, then we have
$$dz = \gamma'(\varphi)\,d\varphi = ire^{i\varphi}\,d\varphi = i(z-z_0)\,d\varphi,$$
so we get
$$\int_0^{2\pi} f(e^{i\varphi})\,d\varphi = \int_{\lvert z\rvert = 1} f(z)\frac{dz}{iz},$$
and we see that that leads to Cauchy's integral formula,
$$\frac{1}{i} \int_{\lvert z\rvert = 1} \frac{f(z)}{z}\,dz = 2\pi\: f(0).$$
Best Answer
Use periodicity to rewrite your integral
$$I=\int_{-\pi}^{\pi} \frac{1}{13-5\sin\theta}\,\mathrm{d}\theta$$
With the change of variable $t=\tan\frac\theta2$,
$$I=\int_{-\infty}^{+\infty}\frac{2\mathrm dt}{(1+t^2)\left(13-5\dfrac{2t}{1+t^2}\right)}=\int_{-\infty}^{+\infty}\frac{2\mathrm dt}{13t^2-10t+13}$$
Then
$$I=\dfrac2{13}\int_{-\infty}^{+\infty}\frac{\mathrm dt}{\left(t-\dfrac5{13}\right)^2+\left(\dfrac{12}{13}\right)^2}=\dfrac{2}{13}\left(\dfrac{13}{12}\right)^2\int_{-\infty}^{+\infty}\frac{\mathrm dt}{\left(\dfrac{t-\frac5{13}}{\frac{12}{13}}\right)^2+1}$$
Now with the change of variable $u=\dfrac{t-\frac5{13}}{\frac{12}{13}}$,
$$I=\dfrac{2}{13}\left(\dfrac{13}{12}\right)^2\dfrac{12}{13}\int_{-\infty}^{+\infty}\dfrac{\mathrm du}{1+u^2}=\dfrac{2}{13}\left(\dfrac{13}{12}\right)^2\dfrac{12}{13}\pi=\frac{\pi}{6}$$