A stopping criterion for nonbinary LDPC codes over GF(q)