zp->z_sync_cnt should not use atomic operations on Linux

On most UNIX systems, the VFS will notify the filesystem about all
open() and close() operations on files and ZFS will take advantage of
this to track the number of synchronous opens in zp->z_sync_cnt. This
affects the zil_commit behavior. However, Linux only notifies us about
the last close on a file, which means that concurrent synchronous opens
will leave zp->z_sync_cnt set to a non-zero value on last close. This
means that all subsequent opens receive synchronous behavior even if
they had not asked for it.

We address this by modifying zfs_open()/zfs_close() to use
zp->z_sync_cnt on Linux as a flag variable that is set on synchronous
open and cleared on synchronous close.

Signed-off-by: Richard Yao <ryao@gentoo.org>