formula 3.749.2 from Gradshteyn & Ryzhik gives: $\int_0^{\infty}\frac{1-x{\rm cotan}x}{x^2+\epsilon^2}dx=\frac{\pi}{2\epsilon}-\frac{\pi}{e^{2\epsilon}-1}$, for $\epsilon>0$. taking the limit $\epsilon\downarrow 0$ gives your $\pi/2$; G&R do not explicitly say that their formula is a principal value integral, but it's the only sensible way to avoid the poles of the cotangent at $\pi,2\pi,...$; note that there is no singularity at $x=0$, so the limit $\epsilon\downarrow 0$ gives no ambiguity.