Use version in SSL_METHOD not SSL structure.

When deciding whether to use TLS 1.2 PRF and record hash algorithms
use the version number in the corresponding SSL_METHOD structure
instead of the SSL structure. The SSL structure version is sometimes
inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already.
(CVE-2013-6449)
Ignore NULL parameter in EVP_MD_CTX_destroy.
Fix DTLS retransmission from previous session.

For DTLS we might need to retransmit messages from the previous session
so keep a copy of write context in DTLS retransmission buffers instead
of replacing it after sending CCS. CVE-2013-6450.
Don't use rdrand engine as default unless explicitly requested.
(cherry picked from commit 8f68678989a198ead3ab59a698302ecb0f1c8fb1)