Fix infinite recursion for NegativeInfinity when doing mod with a number

Fixes https://github.com/sympy/sympy/issues/7742