pop jobs until the queue is empty or we find a nil