Use SHA1 for default #retry_identifier
Match exception instance against retry_exceptions

This allows to 'tag' exceptions with a module instead of having to
wrap them in custom exception classes, which is useful when you want
to keep the original exception for logging and diagnosis after the
retry limit was exceeded. Using the === operator makes the matching
work the same as the ruby rescue clause.

Example:

module TransientError; end

def foo
  ...
rescue Timeout::Error => e
  raise e.extend(TransientError)
end

class SomeJob
  def self.retry_exceptions
    [TransientError]
  end
  ...
end

The old behaviour of the public method retry_exception? so that you
can alternatively pass an exception class instead of an exception
instance to it is kept but documented as deprecated.

This is a reworked version of this commit:

https://github.com/til/resque-retry/commit/cfa397048430ed437c91abffeb4659f59d48ac15
Update HISTORY.md with @til's changes.
Cutting v1.0.0 for public release.
Merge pull request #48 from d11wtq/sha1-retry-identifier

Use SHA1 for default #retry_identifier
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.