[scudo] Check the return values of the pthread_* functions

Summary:
Currently we are not enforcing the success of `pthread_once`, and
`pthread_setspecific`. Errors could lead to harder to debug issues later in
the thread's life. This adds checks for a 0 return value for both.
If `pthread_setspecific` fails in the teardown path, opt for an immediate
teardown as opposed to a fatal failure.

Reviewers: alekseyshl, kcc

Reviewed By: alekseyshl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33555

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303998 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed