Added constructor for threasd guard; impl.h/.cpp:  Replaced thread guard member with pointer to it.