Use xmlUnlinkNode() before xmlFreeNode()

This prevents a double-free crash.