xml/diff: don't leak the libxml document on import

(cherry picked from commit 795a5382c20ed9d046a64100db9e403f03b08487)
xml/diff: don't leak the nolibxml buffer on failure to parse

(cherry picked from commit a1994d6d7a62a93476521860d782df4e9b2ff7f3)