Fix race condition in Pop()