fix failing tests without X in IPython.lib

note that pylab_not_importable appears to not be enough to catch if
we're running X. I'm able to import pylab, and it's only %%matplotlib
magic that causes these tests to die