Close the remote file handle if sftp_put_file's fstat fails.

Instead of abruptly returning from sftp_put_file in that situation, we
now send an FXP_CLOSE instead. Patch due to Tim Kosse.
Add a missing freeaddrinfo() in Unix sk_newlistener.

If we use getaddrinfo to translate the source IP address into a
sockaddr, then we need to freeaddrinfo the returned data later. Patch
due to Tim Kosse.
Fixes to memory management in the elliptic curve code.

There was an error-handling path testing the wrong variable; an
inappropriate call to ec_point_free in decodepoint() (in fact, that
function always gets passed a pointer to an ec_point structure that's
not a dynamically allocated block at all or not in its own right, so
we should have just cleared its contents without freeing the structure
itself); a missing return on an error path which would have caused the
same structure to be freed a second time; and two missing freebn in
ecdsa_sign.

Patch due to Tim Kosse.
Fix a handle leak in Windows PSFTP.

We were checking the return value of CreateThread for validity, but
not keeping it to free afterwards if it _was_ valid. Also, we weren't
closing ctx->event in the valid case either. Patch due to Tim Kosse.
Fix memory management in bignum_random_in_range.

We were allocating a new array in which to make up a random number
every time we went round the loop, and not freeing any of them. Now we
allocate a single array to use for all loop iterations, and clear and
free it properly afterwards.

Patch due to Tim Kosse.
Do an smemclr(bytes) in bignum_random_in_range.

It's used for sensitive data, so we shouldn't leave it lying around
after free.
Merge branch 'pre-0.64'