Set a job status to FAILED when an exception is thrown.

This change sets the current job status to FAILED when an exception
happens.  This change was made so a job can be requeued after failure
(jobs that end successfully/with an OK status can not be requeued).
Merge pull request #2 from tohann/master

Set job status to FAILED when an exception occurs.