Add a lock to protobuf client when writing to connection to see if this fixes replication replays getting triggered.