On deadfs return ENXIO error instead of EBADF and EIO

There are few places were EBADF/EIO is used and there are places where ENXIO
is used. Unify and use ENXIO everywhere as it matches this situation better.

NFS and other filesystems in XNU returns this error on a filesystem without
alive backend.
Fix compiler warnings

- Compare unsigned variable with 0
- Remove unused variable
Fix calculation of va_data_alloc

fat->blocks holds the number of 512 byte blocks allocated by the file.
Add a Darwin 11 definition of fuse_kludge_vnode.

This definition is actually binary compatible with the Darwin 10 version
with regard to the relevant fields as the only thing that changed
between Darwin 10 and Darwin 11 is the addition of a new member at the
end of the struct, but it is added for completeness.
fuse_kludges.h: Corrected Darwin 11 kludge vnode definition.

Apple changed the definition of lck_mtx_t in Darwin 11 (Mac OS X 10.7),
meaning that offsets in the 'kludge' vnode definition were incorrect.
So Darwin 11's struct vnode is not binary compatible with Darwin 10's as
previously assumed.

This incorrect definition causes problems for fuse_kludge_exchange and
fuse_kludge_vnode_isrecycled. In the former case, memory corruption
could occur and undefined behaviour may follow (serious issue). In the
latter case, the function would return the wrong result.
Clean up volume capabilities

* Set VOL_CAP_FMT_SPARSE_FILES because OSXFUSE/FUSE4X already support sparse files.

* Set VOL_CAP_FMT_CASE_SENSITIVE because there are FUSE file systems that are
  case-sensitive.

* Set VOL_CAP_FMT_HIDDEN_FILES to allow hidden files on FUSE volumes. In case of
  file system not supporting hidden files or if getattr_x/setattr_x are not
  implemented, nothing happens when "chflags [no]hidden" is called on a file.
  There should be no harm in that.

* Add new capability bits introduced in Mac OS X 10.6 and 10.7 (disabled by
  default).
Remove FUFH_INVALID enum value
Remove FUSE4X_ENABLE_DSELECT code

This is macfuse specific extension that has been disabled in fuse4x for a long time.
This is a dead code, nobody uses it so remove it.
Remove FUSE4X_ENABLE_KQUEUE code

This is macfuse specific extension that has been disabled in fuse4x for a long time.
This is a dead code, nobody uses it so remove it.
Use rbtree instead of node_hash

XNU does not allow to specify unique id to a vnode. And when fuse returns
'ino' it is not possible to restore vnode for it. Thus fuse have to track
ino->vnode by itself.

Before fuse4x had a global map (device_id,ino)->fuse_vnode_data
implemented by nodehash.c. nodehash.c itself a poorely implemented hash structure.
Beside unreadable and overcomplicated code such structures are not
usual for kernel. Both BSD and Linux use rb-tree structure for maps, so
fuse4x should do the same.

Use rb tree implementation from OpenBSD. Keep one tree ino->fuse_vnode_data per
mountpoint.
Rename FSNodeScrub to more readable fuse_vnode_data_destroy
Remove biglock

Biglock has a few disadvantages:
 - it's a source of deadlocks when one vnop generates another vnop
 - it reduces fuse scalability by effectively making it single-threaded
 - is is enabled only in 64bit kernel, so codepath differs for 32 and 64bit
 - it has unreadable source code and makes fuse implementation more complex than it should be

Remove biglock and nodelock, mark fuse as THREADSAFE. This means that several vnops can
be generated for the same vnode simultaneously. Fuse should protect shared state correctly.
One such thing is fuse_file_handlers array in fuse_data.
Add fufh_mtx mutex - it should be locked if you modify file_handlers.
Eliminate FUSE4X_TRACE

Move its functionality to FUSE4X_TRACE_OP and FUSE4X_DEBUG
Remove unused entries from vnops array
Move vnops declaration to *.c file

There is no reason to declare vnops in the header, they are not used anywhere outside of fuse_vnops.c
Move exchange function implementation from kludge.c to compat dir

"kludge" term is misleading. compat is more widely used term for
reimplemented stuff. Move the code to compat/exchange.c
Add a stub for VNOP_ALLOCATE

On vnop_allocate (file space preallocation) do nothing and just return success.
This is needed for programs that preallocate file space ahead.
If fcntl with PREALLOCATE is called then fuse4x returns an error,
and a user program thinks that media does not have enough space. But
in fact fuse4x returns ENOTSUP (syscall is not supported).

Add a stub that returns success and makes the user-space programm believe that
media has enough space.

The long-term solution is to add FUSE_FALLOCATE fuse request type and implement it
in kext.
Add a shortcut for vnop_reclaim in case of dead filesystem

In case if the fuse filesystem is dead there is no much sense to
make requests to userspace. Instead skip these steps and just
perform finalization.
Invoke FUSE_DESTROY only after we reclaim all vnodes

Send FUSE_DESTROY only after reclaiming all vnodes.
Otherwise the userspace does not receive reclaim commands.