[TSAN] Fix tsan on FreeBSD after D54889

Summary:
It appears that since https://reviews.llvm.org/D54889, BackgroundThread()
crashes immediately because cur_thread()-> will return a null pointer
which is then dereferenced. I'm not sure why I only see this issue on
FreeBSD and not Linux since it should also be unintialized on other platforms.

Reviewers: yuri, dvyukov, dim, emaste

Subscribers: kubamracek, krytarowski, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368103 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed