The implementation of __cxa_guard_acquire is a mess. This patch attempts to clean it up. No functionality change is intended.
This cleanup is motivated by upcoming changes. Specifically changes to allow libc++abi to tolerate when pthread_mutex_lock is being intercepted.