Improve collecting malloc stats in ASan

Summary:
This change makes races between updates of thread-local stats and
merging all the thread-local stats together less harmful.

Reviewers: kcc

Reviewed By: kcc

CC: dvyukov, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1572

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