zfs: Boost ZFS mount time by fixing zfs_sync functionality

The main reason behind the slowness on ZFS mount times is that zfs_sync() was
definitely broken. From a ZFS perspective, sync should wait for the underlying
pool to commit all the dirty data.

Previously, a bunch of work was being handed off to the next OSv instance, thus
slowing down the mount process. When tracing the exactly location of the hang,
I found that the actual bottleneck was during the load of an existent SPA,
spa_load(). Going further, I discovered that ZIL replays (if any) are necessary
for the success of spa_load(). zfs_sync() should flush out all the ZIL records
so that there is no need to replay afterwards. That wasn't happening though.

The original implementation in BSD shows that spa_sync_allpools() should be
called when a mount point wasn't specified, i.e. NULL. However, it works
differently in OSv, this clause doesn't even exist.
spa_sync_allpools() will basically sync all pools.

ZFS mount time before the patch:
SSD -> ZFS mounted: 1943.29ms, (+1691.20ms)
Spinning Disk -> ZFS mounted: 13048.46ms, (+12773.31ms) - My old laptop
is incredible horrible!!!

ZFS mount time after the patch:
SSD -> ZFS mounted: 520.28ms, (+160.36ms)
Spinning Disk -> ZFS mounted: 1596.60ms, (+1281.39ms)

About 10 times faster.

It might be better to fix the path that does a sync on the specified file
system, however, it's not something simple, and requires a deep investigation
on the requeriments needed from both the ZFS and the VFS side.

You can see in zfs_sync() that the function call to vfs_stdsync() was removed
as it isn't yet implemented in our VFS layer.
This function basically calls fsync on each opened vnode, which in turn, calls
zil_commit on the correspondent znode.

I have implemented vfs_stdsync(), but that's not enough to fix the sync problem
on the pool. This patch changes zfs_sync() to do sync on the present pools,
in our case, one.

We're fixing a real bug here in the zfs_sync() behavior, and also nicely
boosting the ZFS mount time.

'make check' succeeded.

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