fix reference implementation for folds with zero size tail

AccelerateHS/accelerate#124