io.sockets.secure.openssl: guard against SSL_get_peer_certificate return...

The fix for #1008. I also had to remove two tests and fix the other ones because they only worked on Windows.