patch generated protobuf code to use static buffers