Fixed SSL validation for OS X.

This is a fix for the openssl certificate validation bug that happens on OS X. It's not the cleanest fix (I manually change the error code so that it'll fail correctly), but seems to be a reasonable fix for the issue since we're just replacing our old semi-functional hack with this one. I have a more full-fledged rewrite for the Ruby SDK v2, but this is just backporting a bug fix while we finish up v2 details.

Tested on OS X (Ruby 1.9.3, 2.0.0, 2.1.2), Windows (Ruby 1.9.3, 2.0.0), and Linux (1.9.3, 2.0.0, 2.1.2).