codeGen: Introduce ThreadSanitizer instrumentation
This introduces ThreadSanitizer instrumentation into the code generator to help improve coverage for data-race detection.
The implementation is quite simple, taking the form of a new Cmm pass which adds calls to the appropriate TSAN instrumentation functions on loads, stores, and atomic operations. There are a number of fixes that arose from this work which will be introduced in !9372 (closed) .
Edited by Ben Gamari