Get the retry_attempt for DirtyExit failures, where perform isn't called.

@retry_attempt depends on perform being called, but perform will be called
after forking and set in the child job process. If there is a crash that
prevents the job from notifying the failure hooks itself, then a DirtyExit
exception will be given to the on_failure hooks from a worker processes,
where @retry_attempt will not have been set.

The @on_failure_retry_hook_already_called variable also needs to be
ignored, because this is set to false in the before_perform hook.
Add test for retry attempt being accurate for dirty exit failures.