Fixed bad timeout logic

The condition specifically could be triggered when a job is retried.