Add a configure test for pthread_getspecific, and use it when building ThreadLocal.