Worker task sync issues

This PR solves two issues with WorkerTask:
- ensures that all threads are done when "run_until_finished" returns
- ensures that exceptions are correctly propagated from the controlling thread and only from the controlling thread.

In particular, it could occur that a group would be cancelled from runWorkerThread before run_until_finished could enter its loop, discarding any exception that would occur.
Also, albeit in rarer cases, it could occur that remove_job_ul would be invoked while a job was running, causing an abort due to the jobs semaphore being busy.

The spirit of this fix is to reduce the handling code in runWorkerThread to onlyh mark a group as "ill" and leave the rest to the loop of "run_until_finished".