Refactor: scheduler: reset node counts more efficiently
Previously, the callers of distribute_children() passed it a sorted list of a
resource's allowed nodes, but that was only used to reset their node counts,
for which the order doesn't matter.
Functionize resetting the node counts, and iterate through the allowed nodes
directly rather than unnecessarily creating a sorted list.