sftp: Implement pull support

Implement pull support with a sliding window to improve the speed of
sftp downloads.

The implementation is based on the one from the OpenSSH sftp client.  It
uses up to 64 outstanding read requests.  The limit of 64 is incremented
gradually to prevent overwhelming the server.  The file is fstat()ed to
determine the size.  When the expected size is reached, the maximum
number of outstanding requests is reduced to 1.

The implementation is complicated by the fact that reads can return
short and they can also be serviced out of order.

This patch results in substantial performance improvments, especially
for high-latency links.  Compared to the fallback copy implementation,
other performance improvements are achieved by performing the initial
lstat()/stat() and open() in parallel, as well as performing the
fstat() and initial read requests in parallel.

Some benchmark figures:
Old behavior:
Copying from local server = 6.1MB/s
Copying from local server with 250ms of RTT latency = 0.251MB/s
Copying many small files with 250ms of RTT latency = 0.64 files per second

New behavior:
Copying from local server = 13MB/s
Copying from local server with 250ms of RTT latency = 6.6MB/s
Copying many small files with 250ms of RTT latency = 1.24 files per second

OpenSSH sftp client:
Copying from local server = 14.2MB/s
Copying from local server with 250ms of RTT latency = 6.4MB/s
Copying many small files with 250ms of RTT latency = 1.34 files per second

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