We have
\begin{align} \int_0^\pi e^{a\cos \theta} \cos(a\sin \theta)\, d\theta &= \frac{1}{2}\int_{-\pi}^{\pi} e^{a\cos \theta} \cos(a\sin \theta)\, d\theta \\\ &= \frac{1}{2}\operatorname{Re} \int_{-\pi}^{\pi} e^{ae^{i\theta}}\, d\theta\\\ &= \frac{1}{2}\operatorname{Re} \oint_C e^{az} \frac{dz}{iz} \tag{*}\\\ \end{align}
Since $e^{az}/i$ is analytic inside and on $C$, and $0$ lies inside $C$, Cauchy's integral formula gives
$$\oint_C e^{az} \frac{dz}{iz} = 2\pi i\cdot \frac{e^{az}}{i}\bigg|_{z = 0} = 2\pi.$$
Hence, by $(*)$,
$$\int_0^\pi e^{a\cos \theta}\cos(a\sin \theta)\, d\theta = \pi.$$