Fix RequeueExceptions middleware to handle custom exception matchers.

`rescue` uses === to match, and it allows us to use a custom object
to match an exception, such as matching on both class and message.

This used to work, but got broken by the rubocop stuff, since it
recommended avoiding `===`.

Unfortunately, I hadn't added a spec for it originally :(.