PROTON-1587: fix openssl error handling, causing spurious errors
PROTON-1587: fix openssl error handling, causing spurious errors

From the SSL_get_error() man page:

       In addition  to ssl and ret, SSL_get_error() inspects the current thread's OpenSSL error
       queue.  Thus, SSL_get_error() must be used in the same thread that performed the TLS/SSL I/O
       operation, and no other OpenSSL function calls should appear in between.  The current
       thread's error queue must be empty before the TLS/SSL I/O operation is attempted, or
       SSL_get_error() will not work reliably.

Proton was not clearing the error queue, so the "shutdown-during-init"
error (which was introduced recently in OpenSSL) was left dangling, and was
reported incorrectly when the thread was used to serve another transport.

ChugR/qpid-proton,apache/qpid-proton,alanconway/qpid-proton,alanconway/qpid-proton,ssorj/qpid-proton,astitcher/qpid-proton,kgiusti/qpid-proton,astitcher/qpid-proton,apache/qpid-proton,alanconway/qpid-proton,gemmellr/qpid-proton,kgiusti/qpid-proton,kgiusti/qpid-proton,ssorj/qpid-proton,ssorj/qpid-proton,ssorj/qpid-proton,ChugR/qpid-proton,gemmellr/qpid-proton,ChugR/qpid-proton,alanconway/qpid-proton,ssorj/qpid-proton,apache/qpid-proton,astitcher/qpid-proton,apache/qpid-proton,ChugR/qpid-proton,kgiusti/qpid-proton,ChugR/qpid-proton,gemmellr/qpid-proton,alanconway/qpid-proton,astitcher/qpid-proton,apache/qpid-proton,kgiusti/qpid-proton,gemmellr/qpid-proton,astitcher/qpid-proton,astitcher/qpid-proton,alanconway/qpid-proton,ChugR/qpid-proton,kgiusti/qpid-proton,gemmellr/qpid-proton,gemmellr/qpid-proton,apache/qpid-proton,ssorj/qpid-proton