zfs: cherry-pick commit from master
#15571 30d581121 dnode_is_dirty: check dnode and its data for dirtiness
Obtained from: OpenZFS
Approved by: so
Security: FreeBSD-EN-23:16.openzfs
(cherry picked from commit 30d581121bb122c90959658e7b28b1672d342897)
(cherry picked from commit 5858f93a8b66aa6331d99bed6aad68bc7e9648ba)