TESTING -- override pthreads to fix gstreamer v5
I believe the code is ready and will work properly now in all cases.
but please test before cherry picking this patch, and report
success or failure to me please.
Changes since v1:
- Call pthread_yield to make sure that we link against libpthread.
This fixes the build on saucy.
Changes since v2:
- Set thread_data->detached before creating the thread to prevent
a race condition.
Changes since v3:
- Set thread_data->detached CORRECTLY. Fix a small race between
thread creation and pthread_detach.
Changes since v4:
- Set native thread stack defaults in a similar way to eglibc,
and respect the defaults for win32 again. This fixes the regression
where you can only create 194 threads in java.