Make sure hooks are uninstalled before shutdown.