rc.subr: Move the sleep in wait_for_pids
Instead of sleeping while constructing the list of PIDs to wait for,
sleep briefly after pwait to give init a chance to reap the processes
that just terminated before we loop around and start probing them.
PR: 289630
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D52619
(cherry picked from commit 5953e7c98427e038500221e885dffa181dcc064b)