Fix read-only pool hang on unmount

During mount a filesystem dataset would have the MS_RDONLY bit
incorrectly cleared even if the entire pool was read-only.
There is existing to code to handle this case but it was being run
before the property callbacks were registered.  To resolve the
issue we move this read-only code after the callback registration.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1338
Fix arc_adapt() spinning in iterate_supers_type()

The iterate_supers_type() function which was introduced in the
3.0 kernel was supposed to provide a safe way to call an arbitrary
function on all super blocks of a specific type.  Unfortunately,
because a list_head was used a bug was introduced which made it
possible for iterate_supers_type() to get stuck spinning on a
super block which was just deactivated.

This can occur because when the list head is removed from the
fs_supers list it is reinitialized to point to itself.  If the
iterate_supers_type() function happened to be processing the
removed list_head it will get stuck spinning on that list_head.

The bug was fixed in the 3.3 kernel by converting the list_head
to an hlist_node.  However, to resolve the issue for existing
3.0 - 3.2 kernels we detect when a list_head is used.  Then to
prevent the spinning from occurring the .next pointer is set to
the fs_supers list_head which ensures the iterate_supers_type()
function will always terminate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1045
Closes #861
Closes #790
Add libzfs_core and create new Makefile.am for it.

Update the zfs man page to document concurrent snapshots.

Updates to libzfs.h.
Patch most files in module/zfs.  Still working on dsl_dataset.c and zfs_ioctl.c.
Patch dmu_objset.c.  Since the changes to this file were so vast, my
strategy was to simply use the version of the file directly from Illumos
and then re-ZoL it.
Patch dsl_dataset.c:  The Illumos commit had a bunch of changes to pool
logging that had no corresponding code in the ZoL code.

The corresponding logging was removed as part of ZoL's commit 0443477.
Patch headers in sys/.
Patch zfs_ioctl.c.  This one will certainly need more work due to
its number of Linux-isms and other later Illumos changes such as
feature flags, etc. it has received.
Patch zfs.h.
Patch the rest of the header files.
Patch files in zcommon.
Update dsl_dataset_destroy() directly from Illumos.  The patched version was bogus.
Fix dsl_dataset_user_release_sync().
Update logging in spa_history_log_internal.
Copy spa_history_log_sync() from Illumos.  Add a missing comment block.
Replace log_internal() from Illumos.
Remove placeholder notes.  C90 declaration fixes.  Add missing zvec_legacy_func member to struct zfs_ioc_vec.
Change an instance of "cr" to CRED().  Add registration for zfs_ioc_(create,remove)_minor and
zfs_ioc_events_(next,clear) functions.
s/zfsvfs/zsb ... Minor milestone: all files from the zfs module now compile.
snapshot_one_impl stack reduction:  Move fsname off the stack.
I'm freeing it right away because it doesn't look like anything in the
dmu_objset_hold() call chain stashes it in a a way it will be needed later
(it is, however, copied at one point into another kmem_zalloc'd buffer).