Use thread_local to store each thread's ThreadEnvironment, now that it is supported in GCC.
Add interceptors for pthread_create() and pthread_join(). These do nothing more than check memory accesses and record visible memory changes.