Add NaNs, infinities and overflows support to sum

Stats::sum handles `NaNs` and `Infinities` as elements in the list.
In addition to that, it also detects overflows.

@huonw - your review, please. :-)

Attempting to fix https://github.com/mozilla/rust/issues/11059

(BTW, thanks to @cmr, @sfackler, dybt, @bjz, huon, eibwen for the support on the IRC)