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.