message: more robust perf driver cleanup
diff: @@ -3798,8 +3798,13 @@ void PCM::cleanupPMU(const bool silent)
  {
  for (int i = 0; i < num_cores; ++i)
  for(int c = 0; c < PERF_MAX_COUNTERS; ++c)
  - ::close(perfEventHandle[i][c]);
  + {
  + auto & h = perfEventHandle[i][c];
  + if (h != -1) ::close(h);
  + h = -1;
  + }
  + if (!silent) std::cerr << " Closed perf event handles\n";
  return;
  }
  #endif
  