Fixed bug; wrong mutex used to detect deactivated in dequeue