Fix race condition in worker startup