Main idea: the denominator decays when the real part is large, uniformly in the imaginary part, while the numerator decays when the imaginary part is large and positive, uniformly in the real part. So if you want a piece of the contour integral to decay, it should be a vertical or horizontal segment with either a large real part or a large positive imaginary part. And in the horizontal case you should avoid the zeros of the denominator.
From this I came up with two methods.
Method 1: take $C_R$ ($R \in \mathbb{R_+}$) to be a rectangle with vertices at $-R,R,R + i \pi,-R + i \pi$. Then the integral over the two vertical segments decays as a result of the growing $e^z,e^{-z}$ terms respectively. The integral over the top horizontal segment does not go to zero but it can be related back to the desired integral. You can sum these and then take the residue at the one pole that is enclosed by this contour.
Method 2: take $C_n$ ($n \in \mathbb{N}$) to be a rectangle with vertices $-\pi n,\pi n,\pi n(1+i),\pi n(-1+i)$. Again the integrals over the vertical segments go to zero because the denominator grows. The integral over the top horizontal segment now also goes to zero, because we've made the imaginary part large and positive and stayed far away from the zeros of the denominator. The cost we pay is that $C_n$ now encloses $n$ poles, so that in the limit we have to sum the residues of infinitely many poles.
Method 2 can probably be said to be more generalizable, because method 1 only works because of the nice relationship between $f(z)$ and $f(z+i\pi)$ in this particular problem.