See #6608 for discussion.
This removes boost::reverse_lock so that we don't depend on boost 1.50, and replaces it with our own implementation.
This implementation is stricter than boost::reverse_lock. Reverse locking an unlocked lock, and re-locking a lock while a reverse_lock is active are both errors.