To join a thread, the mutex must be released - another thread
in pushTask() could add a new thread to maWorkers at that point,
which must of course not be deleted.
Avoid the problem by transferring ownership of the to-be-deleted
threads to the calling thread.
(regression from bdaa13a87744e424d3c210fc7f3f9e4f199d8279)
Change-Id: I9d4fcfe4cb46a336586b5663934a12d47b2d8ccb