LWHists+CxxUtils: Enable thread-safety checking and fix warnings.
This should make the memory allocators used by LWHists thread-safe. So it should be ok to concurrently manipulate distinct LWHist objects. However, it is not safe to concurrenty modify the same LWHist object.