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).$$
Let $z=e^{i\theta}$, then $dz=ie^{i\theta}d\theta=(-\sin \theta+i\cos \theta)d\theta$.
Next, we note that
$$e^{-1/z}=e^{-\cos \theta}\left(\cos (\sin \theta)-i\sin(\sin \theta)\right)$$
and thus
$$\begin{align}
e^{-1/z}dz&=e^{-\cos \theta}\left(\cos (\sin \theta)-i\sin(\sin \theta)\right)(-\sin \theta+i\cos \theta)d\theta\\\\
&=e^{-\cos \theta}\left(-\sin \theta \cos (\sin \theta)+\cos \theta \sin(\sin \theta)+i(\cos \theta \cos (\sin \theta)+\sin \theta \sin(\sin \theta))\right)\\\\
&=e^{-\cos \theta}\left(-\sin (\theta-\sin \theta)+i\cos(\theta +\sin \theta) \right)
\end{align}$$
Note that the first term $e^{-\cos \theta}(-\sin (\theta-\sin \theta))$ is an odd function of $\theta$ and inasmuch as it is also periodic with period $2\pi$, its integral $\int_0^{2\pi}e^{-\cos \theta}(-\sin (\theta-\sin \theta))d\theta=0$. We are left with
$$\oint_C e^{-1/z}dz=\int_0^{2\pi}e^{-\cos \theta}(i\cos(\theta +\sin \theta))d\theta$$
Best Answer
As mentioned by Felix Marin in comments, the integral diverges for $a\ge1$. However we shall verify ComplexYetTrivial's claim that $I=\frac{4E(a^2)}{1-a^2}$ if $a\in[0,1)$. Elliptic integrals follow Mathematica/mpmath conventions in this answer.
Using Byrd and Friedman 289.09: $$I=\int_0^{2\pi}\frac{\sqrt{a^2+2a\cos\theta+1}}{(a\cos\theta+1)^2}\,d\theta=2\int_0^\pi\frac{a^2+1+2a\cos\theta}{(a\cos\theta+1)^2}\frac1{\sqrt{a^2+1+2a\cos\theta}}\,d\theta\newcommand{sn}{\operatorname{sn}}$$ $$=\frac4{a+1}\int_0^{K(m=4a/(a+1)^2)}\frac{a^2+1+2a(1-2\sn^2u)}{(a(1-2\sn^2u)+1)^2}\,du$$ $$=\frac4{(a+1)^2}\int_0^{K(m)}\left(\frac{a-1}{(1-\frac{2a}{a+1}\sn^2u)^2}+\frac2{1-\frac{2a}{a+1}\sn^2u}\right)\,du$$ Now using B&F 336.01 and .02: $$\int_0^\varphi\frac1{1-n\sn^2u}\,du=\Pi(n,\varphi,m)$$ $$\int_0^\varphi\frac1{(1-n\sn^2u)^2}\,du=\frac1{2(n-1)(m-n)}\left(nE(\varphi,m)+(m-n)F(\varphi,m)+(2mn+2n-n^2-3m)\Pi(n,\varphi,m)-\frac{n^2\sn u\operatorname{cn}u\operatorname{dn}u}{1-n\sn^2u}\right)$$ we get after much simplification (note that $\varphi=\pi/2$ here) $$I=2\left(\frac{K(m)}{a+1}-\frac{E(m)}{a-1}\right)$$ which is in turn simplified by a Gauss transformation to $$I=\frac{4E(a^2)}{1-a^2}$$