perf_event, x86: Fix 'perf sched record' crashing the machine