[scudo] Lock FallbackTSD before draining it

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

Bug: 281740882

GitOrigin-RevId: 6561032e1d3c561b3f7ced817bf3350b8622bf92
Change-Id: I4225b1f9a9c4e353553c92627591f1f5695e9227
Mreged-In: I4225b1f9a9c4e353553c92627591f1f5695e9227
(cherry picked from commit c3ba0f1d13d228616f57a714a3fc28a1fae83b37)
diff --git a/standalone/tsd_exclusive.h b/standalone/tsd_exclusive.h
index 9d03773..2383674 100644
--- a/standalone/tsd_exclusive.h
+++ b/standalone/tsd_exclusive.h
@@ -63,7 +63,9 @@
     // We don't have a way to iterate all thread local `ThreadTSD`s. Simply
     // drain the `ThreadTSD` of current thread and `FallbackTSD`.
     Instance->drainCache(&ThreadTSD);
+    FallbackTSD.lock();
     Instance->drainCache(&FallbackTSD);
+    FallbackTSD.unlock();
   }
 
   ALWAYS_INLINE void initThreadMaybe(Allocator *Instance, bool MinimalInit) {