Crush: Backporting fixes for #9492 to firefly

The fixes for #9492 are backported from master to firefly. The fix ensures that at most num-rep osds are selected for firstn and indep rules