[PATCH 17/20] qemuMigrationCookieCapsXMLParse: Refactor memory handling