Backport PR #5712: monkeypatch inspect.findsource only when we use it

rather than all the time, so it doesn't affect use outside IPython

closes #5710