Fix OpenSSL memory leaks

http://stackoverflow.com/questions/11759725/opensslssl-library-init-memory-leak