ipython: Add backwards compatibility with old stable releases of IPython

This change makes the IPython plugin work with:

  * IPython 2.0.0-dev
  * IPython 1.2.1
  * IPython 0.13.2

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726332