Illumos #4101, #4102, #4103, #4105, #4106, #4730, #4756

Please see individual commits. This stack pulls in a number of patches, and aligns us more closely with the illumos code.

EDIT: Compiling and testing this set of patches requires an SPL change as well: zfsonlinux/spl#363