Having _REENTRANT defined is required for TThread to work properly.

Not having it means (See TVirtualMutext.h) that the LOCKGUARD macro are empty.
fix fatal typo in mutex name
Add missing locks
Avoid deadlock by reducing the length of time we hold the lock
improve const correctness