remove many thread_local
factor 2 less
factor 2 less
factor 2 less
remove many thread_local
Merge pull request #4293 from VinInn/TLScleanup

TLS cleanup