Fix backported ssl_match_hostname for http://bugs.python.org/issue17980