Fix leak in removing shutdown error handler when a job throws an exception.