replace compiler-supported TLS with pthread_get/setspecific; remove GPLv3 code from two commits ago