Using TLS for storing thread object