Terminate when a worker thread dies