sha: change loop condition to be tighter.

This makes no change to the way the code functions, but should make
it easier for static analyzers to see the valid range for i

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
