Core/IPC: Fixed a possible crash on shutdown