Made TSocketHandle distinct and fixed problems it caused for SSL.