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 d92e0d62c9e38058fd46c97beb08764538878592)