integrals.transforms: Fix for issue 2486

This tries to fix issue 2486.

https://github.com/sympy/sympy/issues/2486