pw userdel: destroy home dataset if empty
When removing a user's home directory, if the directory is a ZFS
dataset, it cannot be removed. If the directory has been emptied,
use "zfs destroy" to destroy it. This complements the automatic
dataset creation in adduser. Note that datasets within the directory
and snapshots are not handled, as the complete path is not constructed.
While here, add waitpid() calls to rmat() and pw_user_del().
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D45348
Approved by: re (cperciva)
(cherry picked from commit d2f1f71ec8c62dd26d6169d0d671a5aa5a933c1a)
(cherry picked from commit cd13258d266411c39944021ae46f5fcd724faa4a)