fix wait_pull_front in case the queue is closed while empty.