[Bug 525295] python: fix potential hang during ssl handshake