Lock the queue during updates (enqueue/dequeue)