improve asserts in Thread2, Mutex and Cond