[PATCH 5.4 249/388] perf mem2node: Avoid double free related to realloc