separate variable assignments from read usage
only wrap captured variables that are actually changed in or after closure (closes #3548)