Add some locking in _papi_hwi_shutdown_global_internal
Add some locking in _papi_hwi_shutdown_global_internal

This caused a glibc double-free warning, and was caught
by the Valgrind helgrind tool in krentel_pthreads

There are some other potential locking issues in PAPI_shutdown,
especially when debug is enabled.

pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi