Openssl: add thread support and fix initialization