Fixed deadlock when one queues drains.