[PATCH 6.6 365/638] perf record: Fix possible incorrect free in record__switch_output()