Added error option to enable custom error handling

This error handler is only called when the session save/destroy methods are called via the middleware.

This has enabled us to log these errors with our choice of logging tool.

Hopefully this is useful. Appreciate any feedback.
I agree that the `on` syntax makes it clear that the value must be a function. It also matches the onHeaders library naming convention. I could go either way...

Is anyone else pro/anti this name change?