Implement re-entrancy guard on Darwin/x86