Rewrite thread CustomTLS to support keyed TLS entries

Our Thread struct allowed plugins or other parts of the runtime to use
a single custom_tls_ void* pointer to store additional data in the
Thread struct. Unfortunately it was limited to a single value. This CL
changes the API to allow one to pass in a const char* key that is used
to address the TLS data. This lets multiple plugins or parts of the
runtime set their own independent TLS entries. This also adds support
for TLS entries actually being deallocated automatically.

Test: ./test.py --host
Change-Id: I40fa767b9c61a755b2ed910e4ad1e6327705e941
6 files changed