Update kdtree2.cpp

This fixes a bug that causes tree creation to fail for more than about one million points (for me, it failed when using 4004000 points).  Using a single precision variable to sum this many points causes loss of precision (i.e., eventually all but the most significant one or two digits of each new value added to the sum are lost).  The solution is to simply use a double precision float for the sum variable.