XSL extension: use a custom error handler.

The previous error handler was causing a segmentation fault when importing an
invalid stylesheet.