read_state: clear the state variable better

Set read_state back to idle before trying to send anything so that if
the state somehow is wrongly set.

Also, avoid such a case of confusion by resetting the read_state when an
sftp handle is closed.
Removed obsolete include path.
openssl: don't init static structs differently

make_ctr_evp() is changed to take a struct pointer, and then each
_libssh2_EVP_aes_[keylen]_ctr function is made to pass in their own
static struct

Reported by: John Engstrom
Fixes #229
OpenSSL EVP: fix threaded use of structs

Make sure we don't clear or reset static structs after first init so
that they work fine even when used from multiple threads. Init the
structs in the global init.

Help and assistance by: John Engstrom

Fixes #229 (again)
example/ssh2_agent: Print host key fingerprint before authentication

Also moves the comment about not being authenticated to before the
agent authentication takes place, so that it better matches the code.
example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGAIN

Bug: https://bugzilla.redhat.com/745420
libssh2_session_supported_algs: added
Correct Windows include file name case, simplifying cross-compilation

When cross compiling to Windows, libssh2.h include Windows header files
with upper case filenames : BaseTsd.h and WinSock2.h.

These files have lowercase names with mingw-w64 (iirc, it's the same with
mingw). And as on Windows, being lowercase or uppercase does not matter.
windows build: add define to avoid compiler warning

A recent mingw compiler has started to complain on "#warning Please
include winsock2.h before windows.h" unless the magic define is set
first.

Reported by: Vincent Torri
Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-10/0064.shtml
knownhost_add: Avoid dereferencing uninitialized memory on error path.

In function knownhost_add, memory is alocated for a new entry. If normal
alocation is used, memory is not initialized to 0 right after, but a
check is done to verify if correct key type is passed. This test is done
BEFORE setting the memory to null, and on the error path function
free_host() is called, that tries to dereference unititialized memory,
resulting into a glibc abort().

 * knownhost.c - knownhost_add(): - move typemask check before alloc
knownhost_check(): Don't dereference ext if NULL is passed

Documentation for libssh2_knownhost_checkp() and related functions
states that the last argument is filled with data if non-NULL.

"knownhost if set to non-NULL, it must be a pointer to a 'struct
libssh2_knownhost' pointer that gets filled in to point to info about a
known host that matches or partially matches."

In this function ext is dereferenced even if set to NULL, causing
segfault in applications not needing the extra data.
LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000

Some SFTP servers send SFTP packets larger than 40000. Since the limit
is only present to avoid insane sizes anyway, we can easily bump it.

The define was formerly in the public header libssh2_sftp.h but served
no external purpose and was moved into the source dir.

Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-11/0004.shtml
Reported by: Michael Harris
Some NetWare makefile tweaks.
ssh2_exec: skip error outputs for EAGAIN

Since the example uses non-blocking mode, it will just flood the output
with this "nonsense" error.
TODO: remove issues we (sort of) did already
userauth: Provide more informations if ssh pub key extraction fails

If the function that extracts/computes the public key from a private key
fails the errors it reports were masked by the function calling it. This
patch modifies the key extraction function to return errors using
_libssh_error() function.  The error messages are tweaked to contain
reference to the failed operaton in addition to the reason.

 * AUTHORS: - add my name
 * libgcrypt.c: _libssh2_pub_priv_keyfile(): - return a more verbose
                                               error using
                                               _libssh2_error() func.
 * openssl.c: - modify call graph of _libssh2_pub_priv_keyfile() to use
                _libssh2_error for error reporting();
 * userauth.c: - tweak functions calling _libssh2_pub_priv_keyfile() not
                 to shadow error messages
sftp-seek: clear EOF flag

Set the EOF flag to False when calling seek64 to be able to get some
data back on a following read
session_supported_algs docs: added an example
libssh2_session_supported_algs: fix compiler warning
s/1.3.1/1.4.0

We're bumping the minor number