Honour window_size_initial from _libssh2_channel_read

_libssh2_channel_read was using an arbitrary hard-coded limit to
trigger the window adjusting code. The adjustment used was also
hard-coded and arbitrary, 15MB actually, which would limit the
usability of libssh2 on systems with little RAM.

This patch, uses the window_size parameter passed to
libssh2_channel_open_ex (stored as remote.window_size_initial)
plus the buflen as the base for the trigger and the adjustment
calculation.

The memory usage when using the default window size is reduced
from 22MB to 256KB per channel (actually, if compression is
used, these numbers should be incremented by ~50% to account
for the errors between the decompressed packet sizes and the
predicted sizes).

My tests indicate that this change does not impact the
performance of transfers across localhost or a LAN, being it
on par with that of OpenSSH. On the other hand, it will probably
slow down transfers on networks with high bandwidth*delay when
the default window size (LIBSSH2_CHANNEL_WINDOW_DEFAULT=256KB)
is used.
Set default window size to 2MB

The default channel window size used until now was 256KB. This value is
too small and results on a bottleneck on real-life networks where
round-trip delays can easily reach 300ms.

The issue was not visible because the configured channel window size
was being ignored and a hard-coded value of ~22MB being used instead,
but that was fixed on a previous commit.

This patch just changes the default window size
(LIBSSH2_CHANNEL_WINDOW_DEFAULT) to 2MB. It is the same value used by
OpenSSH and in our opinion represents a good compromise between memory
used and transfer speed.

Performance tests were run to determine the optimum value. The details
and related discussion are available from the following thread on the
libssh2 mailing-list:

http://www.libssh2.org/mail/libssh2-devel-archive-2013-10/0018.shtml
http://article.gmane.org/gmane.network.ssh.libssh2.devel/6543

An excerpt follows:

"I have been running some transfer test and measuring their speed.

My setup was composed of a quad-core Linux machine running Ubuntu 13.10
x86_64 with a LXC container inside. The data transfers were performed
from the container to the host (never crossing through a physical
network device).

Network delays were simulated using the tc tool. And ping was used to
verify that they worked as intended during the tests.

The operation performed was the equivalent to the following ssh command:

  $ ssh container "dd bs=16K count=8K if=/dev/zero" >/dev/null

Though, establishment and closing of the SSH connection was excluded
from the timings.

I run the tests several times transferring files of sizes up to 128MB
and the results were consistent between runs.

The results corresponding to the 128MB transfer are available here:

https://docs.google.com/spreadsheet/ccc?key=0Ao1yRmX6PQQzdG5wSFlrZl9HRWNET3ZyN0hnaGo5ZFE&usp=sharing

It clearly shows that 256KB is too small as the default window size.
Moving to a 512MB generates a great improvement and after the 1MB mark
the returns rapidly diminish. Other factors (TCP window size, probably)
become more limiting than the channel window size

For comparison I also performed the same transfers using OpenSSH. Its
speed is usually on par with that of libssh2 using a window size of 1MB
(even if it uses a 2MB window, maybe it is less aggressive sending the
window adjust msgs)."
Set channel window and packet size from configurable values on the session object

Currently, the channel and packet window sizes can only be configured when
"libssh2_channel_open_ex" is used to create the channel. Unfortunatelly
this is not always an option. For instance, for some channel types
(i.e. tcp-ip) a different function must be used; in other cases, the
channel is not created explicitly by the user.

This patch adds two new slots into the session structure to
store the default window and packet sizes. Every channel created in
this session will use these values by default (unless a set of different
ones are explicitly set).

A new pair of constants (LIBSSH2_CHANNEL_WINDOW_CONFIGURED and
LIBSSH2_CHANNEL_PACKET_CONFIGURED) are also defined. These can be used
on function calls were the packet and/or window size are passed
to indicate that the configured values are to be used.

Note that this patch does not introduce any way to set or change
the values on the session object yet.
add functions libssh2_session_config_(set|get)

There are several session parameters that can be reconfigured by the
user (compress, sigpipe, blocking, timeout and channel window and
packet size).

Currently, libssh2 lacks an uniform way to manipulate those
parameters. For "compress" and "sigpipe" "libssh2_session_flag" is
available which allows to change but not to retrieve these flags
values. For "blocking" and "timeout" there are
"libssh2_session_(set|get}_(blocking|timeout)" functions available,
though "libssh2_session_set_blocking" returns the old blocking setting
while "libssh2_session_set_timeout" is a void function.

The new "libssh2_session_config_set" and "libssh2_session_config_get"
functions provide a uniform interface for setting and getting
respectively the configurable session parameters.

A new set of constants to be used as the selector keys are also
defined (they are LIBSSH2_SESSION_CONFIG_SIGPIPE,
LIBSSH2_SESSION_CONFIG_COMPRESS,
LIBSSH2_SESSION_CONFIG_CHANNEL_WINDOW_SIZE,
LIBSSH2_SESSION_CONFIG_CHANNEL_PACKET_SIZE,
LIBSSH2_SESSION_CONFIG_TIMEOUT and LIBSSH2_SESSION_CONFIG_BLOCKING).
modify examples to use the new libssh2_session_config_(set|get) functions