ProtobufScalarJsonSerializers: avoid detaches when iterating containers
Mark the array(s) const to avoid unexpected detaches when using range
based for loops.
Also mark the iterating-value const-ref for performance and correctness.
Furthermore resolve the shadowing of a 'value' variable, which is
already a function argument.
Amends 6a1012792c8909e70c2636b75961e7a8bb949031.
Pick-to: 6.11 6.10 6.8
Task-number: QTBUG-144771
Change-Id: Ia040bc91d45161ac3453221f51ad34786ff1138c
Axivion-Id: qt_Add-ons_qtgrpc_dev_linux:SV120
Axivion-Id: qt_Add-ons_qtgrpc_dev_linux:SV121
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>