Add portability support for PThread's TLS API