TLS fix using pthreads on non-windows platforms instead of thread_specific