Get Tracer working after ipapi.get replaced with get_ipython

Commit 790f731 replaced `ipapi.get` with a `get_ipython` function,
that changed the API slightly, returning None when no InteractiveShell
instance has been registered.
Merge pull request #3511 from punchagan/fix-tracer

Get Tracer working when no IPython instance is running