Add curl and OpenSSL locking to init/term.