zfs: update zfs_write to check for maximum allowed offset

Code ported from FreeBSD, commit hash for reference: 2063f01
Small step towards synchronicity with FreeBSD's ZFS codebase
and POSIX compliance.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>