(compat/rxml/rxml.c) Add some robustness checks