eliminate closure creation from (if)

this also necessitates an IR change, which probably had to be done
anyways in the future to distinguish between global variable creation,
local variable creation, and just setting a variable.