Fix calls to CompareAndSwap in ProtobufClient