Always run AfterDisconnectedHook on shutdown.