WebAgg: pylab compatibility

Fixes #1638 in a temporary way so that WebAgg works with `ipython --pylab`.  Once the IPython side of the integration is complete, this will probably no longer be necessary.