The main question is how do we want to define $\frac1{\sqrt{x^2-1}}$ along $[-1,1]$? There are two possibilities: $\frac1{\sqrt{x^2-1}}=\frac{\pm i}{\sqrt{1-x^2}}$. Once we decide that, things are pretty simple.
We can define
$$
\log\left(\frac{z+1}{z-1}\right)
=\log(3)+\int_2^z\left(\frac1{w+1}-\frac1{w-1}\right)\mathrm{d}w\tag{1}
$$
where the integral is evaluated along any path which does not intersect $[-1,1]$. A closed path avoiding $[-1,1]$ will circle both poles an equal number of times and the residues will cancel.
Therefore, $(1)$ defines $\log\left(\frac{z+1}{z-1}\right)$ with a branch cut along $[-1,1]$. Using $(1)$, we can define
$$
\frac1{\sqrt{z^2-1}}=\frac1{z+1}e^{\frac12\log\left(\frac{z+1}{z-1}\right)}\tag{2}
$$
According $(2)$, the integrand along the top of $[-1,1]$ is $\frac{-i}{\sqrt{1-z^2}}$ and along the bottom of $[-1,1]$ is $\frac{i}{\sqrt{1-z^2}}$. The integral around the two dumbbell ends vanish as their size gets smaller. Thus, the integral counter-clockwise along the whole dumbbell is
$$
4i\int_0^1\frac{\mathrm{d}x}{\sqrt{1-x^2}}\tag{3}
$$
The integral of $\frac1{\sqrt{z^2-1} }$, as defined in $(2)$, counter-clockwise around a circle of essentially infinite radius is $2\pi i$.
Cauchy's Integral Theorem says that the integral around the dumbbell and a circle of essentially infinite radius are the same. Thus, $(3)$ says
$$
4i\int_0^1\frac{\mathrm{d}x}{\sqrt{1-x^2}}=2\pi i\tag{4}
$$
We are back to the question I raised at the beginning: how to define $\frac1{\sqrt{x^2-1}}$ along $[-1,1]$.
If we look at $\frac1{\sqrt{x^2-1}}$ as $\frac1{\sqrt{z^2-1}}$ along the top of $[-1,1]$, then $\frac1{\sqrt{x^2-1}}=\frac{-i}{\sqrt{1-x^2}}$ and we get
$$
\int_0^1\frac{\mathrm{d}x}{\sqrt{x^2-1}}=-i\frac\pi2\tag{5}
$$
If we look at $\frac1{\sqrt{x^2-1}}$ as $\frac1{\sqrt{z^2-1}}$ along the bottom of $[-1,1]$, then $\frac1{\sqrt{x^2-1}}=\frac{i}{\sqrt{1-x^2}}$ and we get
$$
\int_0^1\frac{\mathrm{d}x}{\sqrt{x^2-1}}=i\frac\pi2\tag{6}
$$