Fixes for mayavi2 under qt

When the mayavi2 application is closed, the 'factory' ends up being None