textlib_tests.py: restore value before self.assert
textlib_tests.py: restore value before self.assert

If assert statement raises an error, the correct value is not resored.
Move restoring of value before self.assert statement.

Change-Id: Iffea89f8910bd05001e2b1480ce89b491276a632

wikimedia/pywikibot-core,valhallasw/pywikibot-core,Darkdadaah/pywikibot-core,jayvdb/pywikibot-core,happy5214/pywikibot-core,trishnaguha/pywikibot-core,darthbhyrava/pywikibot-local,npdoty/pywikibot,happy5214/pywikibot-core,icyflame/batman,npdoty/pywikibot,h4ck3rm1k3/pywikibot-core,TridevGuha/pywikibot-core,emijrp/pywikibot-core,wikimedia/pywikibot-core,Darkdadaah/pywikibot-core,hasteur/g13bot_tools_new,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,h4ck3rm1k3/pywikibot-core,magul/pywikibot-core,VcamX/pywikibot-core,xZise/pywikibot-core,hasteur/g13bot_tools_new,PersianWikipedia/pywikibot-core,magul/pywikibot-core,smalyshev/pywikibot-core