Fix SSLv3 warnings being issued on connection reuse.

And also improve tlsHandshake code a bit in the process, mostly by being
more explicit about error conditions.