perf_events: Fix races and clean up perf_event and perf_mmap_data interaction