ftp: Only send permission bits for SITE CHMOD

Some ftp servers give an error if more bits than just the permission
bits are sent for SITE CHMOD so only send the permission bits.

https://bugzilla.gnome.org/show_bug.cgi?id=733281
afp: Fix race between writing and reading

The following sequence of events is possible in GVfsAfpConnection:
send_request_unlocked
write_dsi_header_cb
... return to main loop ...
read_dsi_header_cb
write_command_cb

This happens if the server sends its response before the main loop gets
a chance to run since write_command_cb is executed asynchronously as an
idle function.  It causes the job to hang because the request is only
stored in the request hash table in write_command_cb and so the response
is ignored when being processed because it cannot find the corresponding
request.

To fix this, store the request in the hash table before the request is
written.

https://bugzilla.gnome.org/show_bug.cgi?id=733133
afp: Try to prevent idle disconnects

Some servers (e.g. OS X 10.8) disconnect clients who don't respond to
server notifications.  Prevent this by sending FPGetVolParms, as the
spec suggests.

https://bugzilla.gnome.org/show_bug.cgi?id=734194
afp: Don't retry read if connection closes

Don't retry the read if the remote host closes the connection.  Instead,
exit (semi-)gracefully with exit(0) and exit with an error if there was
an actual error.

https://bugzilla.gnome.org/show_bug.cgi?id=710490
afp: Remove old TODO

https://bugzilla.gnome.org/show_bug.cgi?id=734194
ftp: Check connection is usable when acquiring

Qhen acquiring a cached connection, it might have timeout'ed or
otherwise not be available anymore. We don't want these connection
errors to propagate into the job we're handling and instead just acquire
the next connection.

https://bugzilla.gnome.org/show_bug.cgi?id=591054
ftp: Also mark connection as unusable on G_IO_IN

There is data waiting on an FTP connection and we didn't request it.
It's not ours and we have no way to clear it. Just makr this connection
as unusable.

Most likely this is the server notifying us about a timeout or other
connection abort, so it's a good idea to treat it as an error anyway.

Also includes a new debug message for when we mark a connection as
unusuable and why.

https://bugzilla.gnome.org/show_bug.cgi?id=591054
ftp: Only free connection if non-NULL

Only attempt to free the connection if it is non-NULL, to prevent
warnings like the following:
** (process:30854): CRITICAL **: g_vfs_ftp_connection_free: assertion 'conn != NULL' failed

The connection can be NULL if g_vfs_ftp_connection_new is cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=591054
computer: Fix a memory leak

https://bugzilla.gnome.org/show_bug.cgi?id=734695
daemon: Fix a memory leak

https://bugzilla.gnome.org/show_bug.cgi?id=734695
afp: Fix some memory leaks

https://bugzilla.gnome.org/show_bug.cgi?id=734695