sshfs: fstat workaround

Add "-oworkaround=fstat" for SFTP servers which don't support
the FSTAT message.
Add "FIXME: really needs LSETSTAT extension (debian Bug#640038)"
Remove "-oPreferredAuthentications" from ssh options

Remove "-oPreferredAuthentications" from ssh options if the
"password_stdin" option is used.  Reported by E. Kuemmerle
Fix double free if reconnection races with request sending

Patch by E. Kuemmerle
Add locking around modifver and connver
Submit max 32k reads and writes to the sftp server

Also don't limit the kernel to 64k reads and writes, rather split into
32k sized chunks and send them to the server all at once.  This is
more efficient and less demanding from the server.

Reported by Ludovic Courtès.  Fix suggested by Niels Möller
Make chown respect the UID mapping policy

Reported and tested by Vivenzio Pagliari
Fix error handling in sshfs_read_end

Reported by Mike Kelly
Fix typo in error message

s/FD_CLOESEC/FD_CLOEXEC/
Fix a possible small memory leak
Add -o idmap=file, -o uidmap=FILE, -o gidmap=FILE

These options allow you to create a pair of local files, with
username:uid/groupname:gid pairs, one per line. Alternatively, files can
be in standard /etc/passwd / /etc/group format.

The uid/gids are for the remote server, their local counterparts are
looked up with a local getpwnam/getgrnam call. Any stat() calls will
show with the remapped local uid/gid, and any chown() calls will be
remapped back to the remote uid/gid.
default to erroring if we can't remap a uid/gid

add a '-o nomap=ignore|error' option, which defaults to 'error'
fix typo in error message
increase portability

getline() isn't widely available yet, use fgets() instead
skip blank lines
Remove some trailing whitespace.

Verified with `cat -vet` and `grep '\s$'`
fix unused but set variables

cache.c: In function ‘cache_add_attr’:
cache.c:167:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable]
cache.c: In function ‘cache_add_dir’:
cache.c:188:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable]
cache.c: In function ‘cache_add_link’:
cache.c:212:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable]
Split fd into separate read and write pipes
Add slave option to run sftp over stdin and stdout

Add -o slave. This option routes the sftp communication over stdin and stdout,
bypassing SSH and network.
make sure idmap files aren't writable by others

otherwise, other local users could change the mapping, and gain access
to things they shouldn't