core: Refactor wcore_tinfo.c

The refactor prepares for supporting environments without TLS and
introduces no behavioral change.

Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel.

Tested-by: Nigel Stewart <nigelstewart@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
core: Prevent leak at thread exit

When the thread exits, teardown the thread-local data in wcore_tinfo.

Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel.

Tested-by: Nigel Stewart <nigelstewart@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
core: Support systems without thread-local storage

XCode 3.1 ships with an old version of gcc that does not support TLS.
There are Waffle users that require support for XCode 3.1.

Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel.

Tested-by: Nigel Stewart <nigelstewart@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Revert "cmake: Require that compiler support keyword '__thread'"

This reverts commit e2cbb8648aeee9856b7897f9fa06bdd771c39ec0.

The reverted patch, if you used clang, effectively made clang>=3.2
or non-ancient gcc a requirement.

XCode 3.1 ships with an old version of gcc that does not support TLS.
There are Waffle users that require support for XCode 3.1.

Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel.

Tested-by: Nigel Stewart <nigelstewart@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Merge branch 'support-no-tls'