Simplify implementation of centralize_sumabs2

Also fix a bounds violation when computing the variance of a vector
with a single element
Merge pull request #7492 from JuliaLang/sjk/centralize_sumabs2

Simplify implementation of centralize_sumabs2