when setting SSL and SSL_CTX options in tests get current options first

Fixes #1352