Revert "Simplify handling of free variables in do-loops."
Revert "Simplify handling of free variables in do-loops."

This reverts commit 1f748c0b541112ce6af9ced309e188320edea16e.

mrakgr/futhark,diku-dk/futhark,ihc/futhark,mrakgr/futhark,diku-dk/futhark,ihc/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,CulpaBS/wbBach,mrakgr/futhark,ihc/futhark,diku-dk/futhark,HIPERFIT/futhark,HIPERFIT/futhark