perf tests: Fix leaks on PERF_RECORD_* test