[BUGFIX] Restore libxml error handler state after clearing