Faster cumsum & cumprod. Fixes #7342.

Should we export `cumsum!` and `cumprod!`?

Note if you include the `copy` operation that would have been needed in https://github.com/JuliaLang/julia/issues/7342#issuecomment-46765487, this implementation is actually a little faster because it only needs to make one pass through the data rather than two.