Converted thread_pool TLS variables to using safe accessors.