Fix histogramdd treatment of events at rightmost binedge

Fixes Github issue #4266