Port weblinkchecker.py from pywikibot/compat

Change-Id: I6df31a11e31e570128a6a16397395fc9b95729bc
Merge "Port weblinkchecker.py from pywikibot/compat"