This fixes a bug where histograms constructed in parallel would sometimes fail to count some samples.