avoid clobbering variables in fold & scan accumulators

See note: [Mutable l-values]

Fixes AccelerateHS/accelerate#114 and AccelerateHS/accelerate#168