Please allow me to elaborate a little on Riemann's and Jeb's elegant exposition.
So imagine the contour $\gamma$ as coming just "above" the real axis from $+\infty$ to $0$ and then swinging counterclockwise around the origin, and then going back just "below" the real axis back to $+\infty$.
As Riemann suggests, we can write $(-x)^{s-1} = e^{(s-1)\log(-x)}$. But what should $\log(-x)$ be equal to for positive $x$?
As Jeb suggested, $-1 = e^{i\pi} = e^{-i\pi}$, so we can write $\log(-x)$ as $\log(e^{i\pi}x) = i\pi+\log{x}$, or as $\log(e^{-i\pi}x) = -i\pi+\log{x}$. However, we must make choices that preserve the continuity of $\log(-x)$ as $x$ moves along the contour in the complex plane. Also, as Riemann specifies, we want $\log(-x)$ to be real when $x$ is negative.
For the piece of the contour from $+\infty$ to $0$, we must choose
$$\log(-x) = -i\pi+\log{x}.$$
On the way back from $0$ to $+\infty$, in order to preserve continuity we must have
$$\log(-x) = i\pi+\log{x}.$$
Thus, the integral for the part of the contour from $+\infty$ to $0$ is equal to
$$\int_{+\infty}^0 \frac{e^{-(s-1)i\pi}e^{(s-1)\log{x}}}{e^x-1}\,dx = e^{-\pi si} \int_0^{+\infty} \frac{e^{(s-1)\log{x}}}{e^x-1}\,dx.$$
And the integral for the part of the contour from $0$ to $+\infty$ is equal to
$$\int_0^{+\infty} \frac{e^{(s-1)i\pi}e^{(s-1)\log{x}}}{e^x-1}\,dx = -e^{\pi si} \int_0^{+\infty} \frac{e^{(s-1)\log{x}}}{e^x-1}\,dx.$$
Now add those two pieces together to get Riemann's result.
For $\Gamma$ and $C_1$ see Fig.1, 2 below.
Let $L^+$, $L^-$ be the upper edge and the lower edge of the segment $y=\gamma_v$,$0<x<\beta_v$ respectively.
Since $$
0=\int_{C_1}\frac{\log(z-\rho_v)}{z^2}dz=\int_\Gamma \frac{\log(z-\rho_v)}{z^2}dz+\int_{L^+} \frac{\log(z-\rho_v)}{z^2}dz+\int_{L^-} \frac{\log(z-\rho_v)}{z^2}dz,
$$
we have $$
\int_\Gamma \frac{\log(z-\rho_v)}{z^2}dz=-\int_{L^+} \frac{\log(z-\rho_v)}{z^2}dz-\int_{L^-} \frac{\log(z-\rho_v)}{z^2}dz.
$$
The value of $\log(z-\rho_v)$ on $L^+$ is $\log|x+i\gamma_v|+i\pi$ and the value on $L^-$ is $\log|x+i\gamma_v|-i\pi$. So we get
$$
\int_{L^+} \frac{\log(z-\rho_v)}{z^2}dz=\int_0^{\beta_v} \frac{\log|x+i\gamma_v|+i\pi}{(x+i\gamma_v)^2}dx$$
and$$
\int_{L^-} \frac{\log(z-\rho_v)}{z^2}dz=\int_{\beta_v}^0 \frac{\log|x+i\gamma_v|-i\pi}{(x+i\gamma_v)^2}dx.$$
Therefore we have $$
\int_{L^+} \frac{\log(z-\rho_v)}{z^2}dz+\int_{L^-} \frac{\log(z-\rho_v)}{z^2}dz=2\pi i \int_0^{\beta_v} \frac{dx}{(x+i\gamma_v)^2},$$
which leads $(2)$.
Best Answer
The contour is not closed, but the value of the integral is independent (for small radius) of the method you might use to close off the contour near $Re(z)=-\infty$ and take a limit.
Near $-\infty$ means modifying the contour only in a region $Re(z) < a$ for large enough negative $a$. In this problem any $a<0$ will leave unchanged the set of poles and residues inside the contour, and as $a \to -\infty$ any changes in the value of the integral due to the contour modification crossing the branch cut, converge to $0$.
The un-modified contour can be considered as a closed integration path on a compactification of the left half-plane by adding a point at real part $-\infty$, which is justified when integrating a power of $z$ that is suppressed exponentially (in $Re(z)$) when approaching the added point.