Array comprehension: Move temp var into function expression.

Manage the temp var manually instead of using `addTempVar` and pass in a `prelude` statement.

Fixes #296