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).