tests: logging: log_msg2: Prevent using negative array index

Move assert check before array access to ensure that
negative index is not used in an array. Coverity CID 222151.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
1 file changed