Add ability to change the requirement for retry

e.g. if using 'Failure' state to indicate an error in build process,
but 'Unstable' indicates a test failure, the job does not need to be retried.

Includes a test.
Merge pull request #40 from tagged/change-retry-condition

Add ability to change the requirement for retry