Add an XML external entity loader.

This allows the use of "data:" and "compress.zlib:" in entities and URIs.

Fixes #2329.
I think you want raise_warning() here, and probably in a few other places as well. PHP calls php_libxml_ctx_error() which despite the name does not raise a fatal error -- PHP_LIBXML_CTX_ERROR is mapped to E_WARNING and PHP_LIBXML_CTX_WARNING is mapped to E_NOTICE.