fix running job infinitely when attempts < 0

I just run into issue where job with 3 max_attempts made 16521 attempts, -16518 remaining.
Still no idea how that could happen, but you should be trying again only if attempts > 0, not if attempts != 0.