ibrcommon: Improved error checking on RWMutex locking.

ibrcommon unit tests on OS X failed:

thread/MutexTests.cpp:116: Assertion
Test name: MutexTests::rwmutex_test_readwrite
expected exception not thrown
- Expected: ibrcommon::MutexException

RWMutex did not check all error conditions. Explicitly added the condition flagged by OS X during the unit tests and added a default case always throwing an exception when the locking does not succeed.