pwait: Add an option to print remaining processes
- On startup, insert all valid PIDs into a tree.
- In our main loop, whenever a process terminates, remove its PID from the tree.
- On exit, if the -p flag was specified, print the remaining PIDs.
MFC after: 3 days
Reviewed by: bcr, markj
Differential Revision: https://reviews.freebsd.org/D53293
(cherry picked from commit 3d73146baeb933fe955c7496572b483a9f92914c)