Core/Shared: Fix world and auth crash on shutdown (PCQ & DbWorker)

Fixes #12704