Function BlockingQueue.waitPop

Blocks until a value is available or the closed queue is fully drained.

Spurious condition-variable wakes are harmless because the wait predicate is always re-checked in a loop.