Some fixes in IPython Sphinx directive

Made two fixes in plot_directive module:

 - a problem with interpreting pure python code with multiple levels of indentation
 - a problem with keeping track of visited files when restarting ipython line numbers