Solve returns correct solution for Equations where denominator becomes 0 (fixes #8666)

With Reference to the issue #8666 

For Equations like: x**2 - 1/(x**2 - 4) == 4 - 1/(x**2 - 4)

Earlier solve returned