Add an extension point for exception logging middleware

For use with things like Sentry, Newrelic etc.

For more discussion of this issue see:

https://github.com/ckan/ckan/pull/1799
Not sure if I should catch the AttributeError that would be raised by middleware that hasn't implemented the extra method? If this PR is accepted I'll send PRs to each of the extensions on Github that don't have inherit=True.