HRCPP-146 Improve trace logging (synchronization fixes)

Forgot to use ScopedLock for hrbytes logging.