Fix infinite loop in task_delete

We are done with this loop even if we did not have to delete the job.
Only InvalidRequestErrors should make us repeat.