signal race fixes
Regression tests for libc_r (pthreads) library.Thanks to pval@ for resolving the license stuff.