XSL extension: use a custom error handler.

The previous error handler was causing a segmentation fault when importing an
invalid stylesheet.

This pull reqest is a candidate for both 3.0.1 and 3.1.0.