Prevent hang in LiveRCPageGenerator
Prevent hang in LiveRCPageGenerator

The socketio client is being disconnected, but continues to poll
for new items indefinitely.

Detect disconnection and stop polling, making LiveRCPageGenerator
fail to fetch the requested total number of items instead of
stalling.

Correct item counter so that the thread quits after total
instead of total+1, reducing the chance of a disconnect.

These changes allows other tests to run after the disconnection,
lowering the impact and frequency of this bug.

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