openssl: fix a 4 year old "use-after-free" problem

* https://rt.openssl.org/Ticket/Display.html?id=2167
* http://www.tedunangst.com/flak/post/analysis-of-openssl-freelist-reuse

Obtained from: OpenBSD