Fixes a potential deadlock. The memory queue should never do any synchronous calls into the database queue (the opposite is allowed, though).