Fix dead lock on failed background jobs.