Fix race condition again.

Previous commit didn't fix it. Moved the part that adds a job to the
'running'  dictionary to be before the worker thread is actually
started. Probably sometimes the worker thread finished before the job
was added.