Create RAII lock guard for global initialization lock.

This patch is a part of a series of cleanups to cxa_guard.cpp.
It should introduce no functionality change.

This patch refactors the use of the global mutex and condvar into
a RAII lock guard class. This improves correctness (since unlocks can't
be forgotten). It also allows the unification of the non-threading and
threading implementations.

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@357669 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 43cb674684655c8ca907f814e90c65b3ea5b9106)

Bug: http://b/189279320
Test: treehugger
Change-Id: Ied307fc69e1ba563e5cb76e454084f9c5827e2d3
1 file changed