Fix overflow on histogram computation

Patch by cyeksigian; reviewed by jmckenzie for CASSANDRA-8028