I would like to add some commentary to the excellent answer by @DrMV,
showing how to compute the residues involved. We will use
$$f(z) = \frac{1}{1+z^2}
\exp(1/2 \times\mathrm{LogA}(1+z))
\exp(1/2 \times\mathrm{LogB}(1-z)).$$
Here $\mathrm{LogA}$ denotes the branch of the logarithm where $-\pi
\lt \arg \mathrm{LogA} \le \pi$ and $\mathrm{LogB}$ where $0 \lt \arg
\mathrm{LogB} \le 2\pi.$ The branch cut from $\mathrm{LogB}$ is inside
the dogbone contour while for $x\lt -1$ both branch cuts apply. In
fact they cancel and we have continuity across the cut and may derive
analyticity by Morera's theorem as explained at this MSE
link.
For the continuity the rational factor is obviously the same above
and below the cut, while for the two logarithmic factors we get for
$x\lt -1$ and above the cut $\mathrm{LogA}(1+x) = \log(-x-1) + \pi i$
and $\mathrm{LogB}(1-x) = \log(-x+1) + 2\pi i$ (rotation) and below
the cut $\mathrm{LogA}(1+x) = \log(-x-1) - \pi i$ and
$\mathrm{LogB}(1-x) = \log(-x+1)$ (rotation again). This yields above
the cut
$$\exp(1/2\times(\log(-x-1)+\pi i))\exp(1/2\times(\log(-x+1)+2\pi i))
\\ = \sqrt{x^2-1} \exp(3/2 \times \pi i) = -i\sqrt{x^2-1}$$
and below the cut
$$\exp(1/2\times(\log(-x-1)-\pi i))\exp(1/2\times(\log(-x+1)))
\\ = \sqrt{x^2-1} \exp(-1/2 \times \pi i) = -i\sqrt{x^2-1}$$
and we have continuity across the cut. (For the cut itself the values
are from the above-the-cut case.) We need to verify that the two
segments above and below the single branch cut enclosed by the dogbone
contour are multiples of the target integral. We get above the cut
$$\exp(1/2\times(\log(x+1))\exp(1/2\times(\log(-x+1)+2\pi i))
= - \sqrt{1-x^2}$$
and below
$$\exp(1/2\times(\log(x+1))\exp(1/2\times(\log(-x+1)))
= \sqrt{1-x^2}.$$
This means that with a counter-clockwise traversal of the contour we
pick up twice the target integral. Next to compute the residues we get
for the easy ones at $\pm i$
$$\mathrm{Res}_{z=i} f(z) \\ =
\frac{1}{2i}\exp(1/2\times (\log \sqrt{2} + i\pi/4))
\exp(1/2\times (\log \sqrt{2} + (2\pi i-i\pi/4)))
\\ = -\frac{1}{2i} \sqrt{2} = \frac{i\sqrt{2}}{2}$$
and
$$\mathrm{Res}_{z=-i} f(z) \\ =
-\frac{1}{2i}\exp(1/2\times (\log \sqrt{2} - i\pi/4))
\exp(1/2\times (\log \sqrt{2} + i\pi/4))
\\ = -\frac{1}{2i} \sqrt{2} = \frac{i\sqrt{2}}{2}.$$
For the residue at infinity we use (no branch cut anymore around
infinity)
$$\mathrm{Res}_{z=\infty} f(z) =
- \lim_{R\rightarrow\infty} \frac{1}{2\pi i}
\int_{|z|=R} f(z) \; dz.$$
Putting $z= R \exp(i\theta)$ we obtain
$$\int_0^{2\pi} \frac{1}{1+R^2 \exp(2i\theta)}
\exp(1/2\times\mathrm{LogA}(1+R\exp(i\theta))) \\ \times
\exp(1/2\times\mathrm{LogB}(1-R\exp(i\theta)))
Ri\exp(i\theta)d\theta.$$
We have two intervals, from $0$ to $\pi$ (upper half plane) and from
$\pi$ to $2\pi$ (lower half plane). In the upper half plane we have
as $R$ goes to infinity that
$$\mathrm{LogA}(1+R\exp(i\theta))
\rightarrow \log(R) + i\theta$$
and
$$\mathrm{LogB}(1-R\exp(i\theta))
\rightarrow \log(R) + i(\theta+\pi)$$
We obtain for the limit
$$\int_0^{\pi} \frac{R}{\exp(-2i\theta)+R^2}
\exp(\log R) \exp(i\theta + \pi i/2) i \exp(-i\theta)\; d\theta
\\ = - \int_0^{\pi} \frac{R^2}{\exp(-2i\theta)+R^2} \; d\theta
\rightarrow -\pi.$$
In the lower half plane we get
$$\mathrm{LogA}(1+R\exp(i\theta))
\rightarrow \log(R) + i(\theta-2\pi)$$
and
$$\mathrm{LogB}(1-R\exp(i\theta))
\rightarrow \log(R) + i(\theta-\pi)$$
This is the sames as before except $\exp(\pi i/2)$ has been replaced
by $\exp(-3\pi i/2)$ which makes no difference (both evaluate to $i$)
and we once more obtain $-\pi$, for a total residue of $-(-2\pi)/(2\pi
i) = -i.$
Now the contour produces twice the desired value as explained earlier
and hence it is given by (poles outside rather than inside contour)
$$\frac{1}{2} \times - 2\pi i \times
\left(-i + i\sqrt{2}\right)$$
which is
$$\bbox[5px,border:2px solid #00A000]{
\pi(\sqrt{2}-1)}$$
as claimed.