message: C API: Fail gracefully if the serialized graph would be too large.
  See for some motivation.
  Without this explicit check, a large graph would trigger an assertion failure
  in the protobuf codebase
  (https://github.com/google/protobuf/blob/0456e269ee6505766474aa8d7b8bba7ac047f457/src/google/protobuf/message_lite.cc#L68)
  Pull Request for google/protobuf:
diff: @@ -631,7 +631,22 @@ Status MessageToBuffer(const tensorflow::protobuf::Message& in,
  "Failed to allocate memory to serialize message of type '",
  in.GetTypeName(), "' and size ", proto_size);
  }
  - in.SerializeToArray(buf, proto_size);
  + // SerializeToArray takes size as an int.
  + // This next 'if' is a workaround till we update to depend on a version
  + // of protocol buffers that includes
  + // https://github.com/google/protobuf/pull/4739
  + if (proto_size > std::numeric_limits<int>::max()) {
  + return InvalidArgument("Cannot serialize protocol buffer of type ",
  + in.GetTypeName(), " as the serialized size (",
  + proto_size,
  + "bytes) would be larger than the limit (",
  + std::numeric_limits<int>::max(), " bytes)");
  + }
  + if (!in.SerializeToArray(buf, proto_size)) {
  + return InvalidArgument("Unable to serialize ", in.GetTypeName(),
  + " protocol buffer, perhaps the serialized size (",
  + proto_size, " bytes) is too large?");
  + }
  out->data = buf;
  out->length = proto_size;
  out->data_deallocator = [](void* data, size_t length) {
  