WorkerTask::run_until_finished: ensure that all jobs are done running when returning and that exception that occurred in the worker threads are taken into account under all circumstances.
Added "log" helper when "DEBUG_LOGGING" is non-zero in the environment