* rpc/blockchain.cpp: Remove g_utxosetscan mutex that is only protecting a single atomic variable
* wallet/wallet.h: Remove mutexScanning which was only protecting a single atomic bool
* net: fMsgProcWake use LOCK instead of lock_guard
* rpc/blockchain.cpp: thread safety annotations for latestblock
* test/checkqueue_tests: thread safety annotations
* util/system.cpp: add thread safety annotations for dir_locks
* logging: thread safety annotations
Adds LockGuard helper in threadsafety.h to replace lock_guard<mutex>
when LOCK(Mutex) isn't available for use.
This is a backport of Core PR16127