Improve the accuracy of the median calculation in fitshistogram.cpp
Previously, the median calculation used a histogram algorithm to find a range that contained the
median value, and chose the median as the center of that range. With this revision, the frequencies
of all samples in the range are calculated, and the exact median can be computed (subject to some
downsampling of the data).