Fix for broken file type plugins

Prevent file type plugins that spin the event loop by displaying a
dialog from causing locking errors. The lock is now acquired only after
the file type plugin has run on import.