Ignore NULL parameter in EVP_MD_CTX_destroy.
(cherry picked from commit a6c62f0c25a756c263a80ce52afbae888028e986)
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.
(cherry picked from commit 34628967f1e65dc8f34e000f0f5518e21afbfc7b)