When failing or resetting a job save the attributes too

This allows you to save additional information when failing a job that
can be used to determine whether to retry or not for example.