Fix for issue 11981
Switch to using pthread_key_t for Thread reference on Posix
Use atomic ops in host test
pthread_key_delete(); Don't use pthread_key_t on OSX
missing else
Merge pull request #719 from radcapricorn/host_test_atomic_ops

DRuntime: Use atomic ops in host test
Merge pull request #718 from radcapricorn/issue_11981

Fix for issue 11981 - deadlock during thread initialization on Posix