Fix race condition on starting worker thread