[PATCH 6.6 462/583] perf header: Fix segfault on build_mem_topology() error path