curl_easy_getinfo: Added CURLINFO_TLS_SESSION for accessing TLS internals

Added new API for returning a SSL backend type and pointer, in order to
allow access to the TLS internals, that may then be used to obtain X509
certificate information for example.
symbols-in-versions: Fixed missing CURLINFO_TLS_SESSION
symbols-in-versions: Added missing CURLSSLBACKEND_* symbols
smtp: Post SMTP command expansion tidy up

Removed unnecessary SMTP_STOP state changes on failure.

Removed hard return on failure in smtp_state_data_resp().
tests: Moved CR LF in URL tests to their respective protocol groups
tests: Added IMAP graceful authentication cancellation tests
ftpserver.pl: Fixed servercmd REPLY with * detection
ftpserver.pl: Fixed unknown IMAP command "*"
ftpserver.pl: Reworked fix from commit 7a36b2abc06862
tests: Added POP3 graceful authentication cancellation tests
tests: Added SMTP graceful authentication cancellation tests
tests: Removed expected QUIT response from graceful cancellation tests

A failure during authentication, which is performed as part of the
CONNECT phrase (for IMAP, POP3 and SMTP) is considered by the multi-
interface as being closed prematurely (aka a dead connection). As such
these protocols cannot issue the relevant QUIT or LOGOUT command.

Temporarily fixed the test cases until we can fix this properly.
tests: Added error code explanation comments
tests: Corrected login "username" authentication responses
tests: Re-ordered test arguments to match other IMAP tests
RELEASE-NOTES: Synced with 35e476a3f6cdd5
hostip: don't prune DNS cache entries that are in use

When adding entries to the DNS cache with CURLOPT_RESOLVE, they are
marked 'inuse' forever to prevent them from ever being removed in normal
operations. Still, the code that pruned out-of-date DNS entries didn't
care for the 'inuse' struct field and pruned it anyway!

Reported-by: Romulo A. Ceccon
Bug: http://curl.haxx.se/bug/view.cgi?id=1303
connect: Try next ip directly after immediate connect fail

This fixes a rare Happy Eyeballs bug where if the first IP family runs
out of addresses before the second-family-timer fires, and the second
IP family's first connect fails immediately, no further IPs of the
second family are attempted.
sigpipe: factor out sigpipe_reset from easy.c

Commit 7d80ed64e43515 introduced some helpers to handle
sigpipe in easy.c. However, that fix was incomplete, and we
need to add more callers in other files. The first step is
making the helpers globally accessible.

Since the functions are small and should generally end up
inlined anyway, we simply define them in the header as
static functions.

Signed-off-by: Jeff King <peff@peff.net>
curl_multi_cleanup: ignore SIGPIPE

This is an extension to the fix in 7d80ed64e43515. We may
call Curl_disconnect() while cleaning up the multi handle,
which could lead to openssl sending packets, which could get
a SIGPIPE.

Signed-off-by: Jeff King <peff@peff.net>