[libc++][test] Remove non-portable assumption that thread's constructor allocates with ::new

Drive-by:
* Fix potential race between check and update of `throw_one` in `operator new`
* Fix latent bug in `operator delete`, which shouldn't decrement `outstanding_new` when passed a null pointer
* Specifically catch the expected `bad_alloc` in `main` instead of `...`

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

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