Well, in general, you should, when dealing with non-positive numbers, treat $\sqrt{x}$ as a set of all numbers such that $y^2=x$. Then you get that $\sqrt{1}=\{+1,-1\}$ and $\sqrt{-1}=\{+\mathrm i,-\mathrm i\}$, and then you get
$$ \frac{1}{\sqrt{-1}} = \frac{\sqrt{1}}{\sqrt{-1}} = \sqrt{\frac{1}{-1}} = \{+\mathrm i,-\mathrm i\}=\{\mathrm i,1/\mathrm i\},$$
and everything seems to be ok now. Of course, this brings a lot vagueness into the equals sign, similar vagueness as one has with Langrange symbols like $f(x)=\mathcal O(x)$.
As pointed in the comments, you can't write $\mathrm i=\sqrt{-1}$ just because $\mathrm i^2=-1$. Actually, $i$ is defined as such a complex number that $\mathrm i^2+1=0$, but nothing more. There are two such numbers, since the polynomial is quadratic irreducible over $\mathbb Q$.