[PATCH 6.7 508/641] perf header: Fix segfault on build_mem_topology() error path