Cherry-pick in IllumOS #4873 again

Conflicts:
	module/avl/avl.c
	module/zfs/dbuf.c
	module/zfs/dnode.c