Fix onnxruntime build on s390x with more recent GCC versions (#26374)
### Description
Port upstream fix for protobuf for s390x.
Fix unused variable warnings.
### Motivation and Context
These changes fix unnoticed issues which might appear when onnxruntime
is compiled on s390x with newer gcc versions.