Make sure the port obtained from parsing a URL is an integer.