fix out of bounds array index with hdr histogram

this almost sounds like a bug with HdrHistogram, check with a unit test.