awk: fix the case where nested "for" loops with the same variable misbehave