engines/ccgost/gosthash.c: simplify and avoid SEGV.

PR: 3275
(cherry picked from commit ea38f020492042bc1d1adc26ef197b0b9cadf968)