Use CompareAndSwap in ProtobufClient instead of locks