Fix import in metadata.py

Importing pywikibot is not enough ; one needs to import textlib too.