build in C99 mode (remove inner for loop declaration)

"khiter_t k" have been declared outside for loop to fix a build error on my system.
gcc version 4.8.1