xmlmemory: handle realloc properly If realloc fails, free original pointer. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>