Sweeping !57000 from master to 22.0. PerfMonEvent: Fix thread-safety checker warnings. See merge request !57051