libxml_use_internal_errors(false) destroyed the internal error list but
left libxml's own last error in place. libxml_get_last_error() falls
back to it once the list is gone, so it kept returning an error while
libxml_get_errors() was empty, although the documentation says that
disabling clears the existing errors.
Reset the last error when the list is destroyed. Calling the function
again while the internal errors are already disabled leaves it alone.
Closes GH-24295.