Fix ForeignThreadExceptions test (dotnet/coreclr#25074)
This test creates a native thread on which it calls a managed callback. It uses
std::thread to create the thread. The problem is that on MUSL based Linux distros,
the default stack size for secondary threads is 80kB, which is not enough for this
test.
Since std::thread has no way to set the thread stack size, the fix is to use
pthreads on Unix and keep the std::thread for Windows only.
Commit migrated from https://github.com/dotnet/coreclr/commit/
1eee9e5338118aeb6afa199658b2fdd4f318414e