[PATCH 5.15 176/317] perf record: Fix possible incorrect free in record__switch_output()