rm-rf: refactor rm_rf_children(), split out body of directory iteration loop
This splits out rm_rf_children_inner() as body of the loop. We can use
that to implement rm_rf_child() for deleting one specific entry in a
directory.
(cherry picked from commit
1f0fb7d544711248cba34615e43c5a76bc902d74)
(cherry picked from commit
ca4a0e7d41f0b2a1fe2f99dbc3763187c16cf7ab)
(cherry picked from commit
85ccac3393e78d4bf2776ffb8c3a1d8a2a909a2a)
(cherry picked from commit
a87d7ff1a60fe359978e12eb34224255a8f33e27)
Gbp-Pq: Name rm-rf-refactor-rm_rf_children-split-out-body-of-directory.patch