main: not use loop variable in goroutine in loop body

Because loop variable are reused in following loops.
Merge pull request #1217 from unihorn/146

main: not use loop variable in goroutine in loop body