Fix race condition in retrying jobs via web UI