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.

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).