Correct termination of work queue