This fixes Lua 5.5 compat in the .c template, where the first loop
variable '_' becomes const in Lua 5.5. Use select() to discard inside
the loop instead.
While here, fix a mismatched variable name in the corresponding header
template.
Reported by: Austin Horstman <khaneliman12@gmail.com>
Closes: https://github.com/freebsd/freebsd-src/pull/2473