fix access-after-free bug in ProducerConsumerQueueTest