fix SSL_OP_ALL being unusable on Windows due to long being 32-bit signed

This is the completion of the fix for #773. Adds tests to catch this for us in the future. (`SSL_CTX_set_session_cache_mode` and `SSL_CTX_get_session_cache_mode` do not have tests as there's no flag >31-bit for them)