perf_counter: Fix a race on perf_counter_ctx