[TypeSystem] Guard the global `ASTSourceMap` with a mutex
[TypeSystem] Guard the global `ASTSourceMap` with a mutex

s_source_map in ClangExternalASTSourceCommon.cpp is unguarded
and therefore can break in multithreaded conditions. This can
cause crashes in particular if multiple targets are being set
up at once.

This patch wraps s_source_map in a function that ensures
exclusivity, and makes every user of it use that function
instead.

<rdar://problem/33429774> lldb crashes after "resume_off"

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

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@308993 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit e0de83b266e35df54d44041689888c89f1447c3b)

apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb