Unmanaged implementation for thin lock