core: Support POSIX platforms without thread-local storage
core: Support POSIX platforms without thread-local storage

That is, support platforms that don't support this code snippet:
    static __thread int x __attribute__((tls_model("initial-exec")))
In its place, use pthread_getspecific().

The POSIX platforms that I'm aware of that don't support tls are Linux
with clang and MacOS.

Signed-off-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>

maurossi/waffle,janesma/waffle,fjhenigman/waffle,fjhenigman/waffle,dcbaker/waffle,chadversary/waffle,chadversary/waffle,dcbaker/waffle,janesma/waffle,waffle-gl/waffle,maurossi/waffle,waffle-gl/waffle,maurossi/waffle,yinquan529/waffle-gl-waffle,janesma/waffle,waffle-gl/waffle,fjhenigman/waffle,waffle-gl/waffle,evelikov/waffle,dcbaker/waffle,evelikov/waffle,yinquan529/waffle-gl-waffle,yinquan529/waffle-gl-waffle,chadversary/waffle,evelikov/waffle