Fix non-C89 declarations in for loops