Fix issues in determining return type of sum/prod along dim

- Fix reductions along dimensions of heterogeneously typed arrays
- sumabs/sumabs2 for Complex64/Complex128 should return Float32/Float64