Reduce scope of exception handling in ssl_wrap_socket

Only catch and handle IOErrors and OSErrors as the comment intended