api.py: Allow `:` in the hostname of lagpattern
api.py: Allow `:` in the hostname of lagpattern

The hostname of lagpattern can be in `<ip_address>:<port>` format.

Bug: T180313
Change-Id: I7b3d82379c8aa082e16e35cd9eaeff6cc4c41fbb

magul/pywikibot-core,magul/pywikibot-core,wikimedia/pywikibot-core,wikimedia/pywikibot-core,PersianWikipedia/pywikibot-core