Fix race conditions in metric methods

Methods which expect to use a mutex must be defined for the pointer
value, because mutexes are not copyable.