Copy _parseClientTCP() from Twisted trunk (to be removed after switch to endpoints)