Task last_error column

This pull request adds a `last_error` column to the Task table and fixes a couple of bugs in a couple of the event handlers.  The purpose of this pull request is to give job type implementers, as well as the core job type, a way to POST why an error occurred.