restore import hook on shutdown