Fixed url parsing for Twisted 13.0.0

`twisted.web.client._parse` is deprecated in twisted 13.0.0, and  _* methods should probably be avoided anyway =)
This pull request replaces the initial call with `urlparse.urlparse`.  The assertion was added because `urlparse` sets the port number to `None` if no port is specified, throwing a rather cryptic error in such cases.