Adjust error handling for Listener callback

Due to the potentially asynchronous nature of middleware, we need to
push the try-catch block down to surround just the listener callback. As
a result, middleware is responsible for catching its own exceptions and
emitting an 'error' event.

The original try-catch is left in place to catch any errors in bad
synchronous middleware. Not guaranteed to catch it all, but might as
well catch some.