ublox: fix out-of-bounds array accesses
This patch fixes several invalid checks like this:
array[i] && i < G_N_ELEMENTS (array)
which should instead be:
i < G_N_ELEMENTS (array) && array[i]
to avoid an out-of-bounds access of the array.
Fixes: c1aa6588