Create an abstraction layer for the threading model. The signatures closely
resemble pthreads for now, since it makes it more obvious to see that this is
purely an indirection layer. In the future, it may turn out to change the
signature, but should be possible to create Win32 equivalents using the same
signatures.
The change to the test is benign as it assumed the pthread threading model;
defining _POSIX_THREADS simply specifies it rather than just including
pthread.h.
Perhaps do something similar to what is done in libcxx at the moment? There we provide an explicit cmake option to select pthreads in case the default selection mechanism (in include/__config) cannot figure out the thread implementation based on the platform.