Add permanent failure hook

Fixes issue 488
https://github.com/collectiveidea/delayed_job/issues/488