QModbusSerialAdu: improve Q_ASSERT checks


In some cases the code was accessing the indicies that were not checked
by the assertions.

This patch improves the situation, making sure that we get a valid
assertion message instead of a plain crash when passing incorrect data.

Amends 3a40a330f5a9ed5e8870ff64b5cb2682c03a467d.

Pick-to: 6.9 6.8 6.5
Change-Id: I2d3f0d3e53f5afed36943c55c93b3c89ce00f38f
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
commitaacf89f0a2031a69d6d848d28875a3ef207953c4
parentf31886db98129710406e7c43794747ca6dca20ff
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeMon, 28 Apr 2025 11:39:36 +0000