[sp]Solution using complex analysis:
Let $z = e^{i\theta}.$ Then $\sin\theta = \frac1{2i}(z - z^{-1})$, $1 - 2a\cos\theta + a^2 = (z-a)(z^{-1}-a)$ and $dz = iz\,d\theta$. So $$I(a) = \oint_\Gamma \frac{(z - z^{-1})^2}{-4(z-a)(z^{-1}-a)}\frac{dz}{iz} = \frac i4\oint_\Gamma \frac{(z^2-1)^2}{z^2(z-a)(1-za)}\,dz,$$ where $\Gamma$ denotes the unit circle. The meromorphic function $$\frac{(z^2-1)^2}{z^2(z-a)(1-za)}$$ has two poles inside $\Gamma$, a double pole at $z=0$ and a simple pole at $z=a$. The residue at $z=0$ is given by $$\def\res{\operatorname{res}}\res(0) = \lim_{z\to0}\frac d{dz}\frac{(z^2-1)^2}{(z-a)(1-za)} = \lim_{z\to0}\frac{4z(z^2-1)(z-a)(1-za) - (z^2-1)^2(1+a^2 - 2az)}{(z-a)^2(1-za)^2} = \frac{-1-a^2}{a^2}.$$ The residue at $z=a$ is given by $$\res(a) = \lim_{z\to a}\frac{(z^2-1)^2}{z^2(1-az)} = \frac{(1-a^2)^2}{a^2(1-a^2)} = \frac{1-a^2}{a^2}.$$ By Cauchy's residue theorem, $$I(a) = \frac i4 2\pi i\bigl(\res(0) + \res(a)\bigr) = -\frac\pi2\Bigl(\frac{-1-a^2)}{a^2} + \frac{1-a^2}{a^2}\Bigr) = \pi.$$
There must be a deeper reason why the result is independent of $a$, presumably something to do with the
Poisson kernel?
[/sp]