move main script to main() and remove obsolete pywikibot.stopme().

In core branch pywikibot.stopme() is called by atexit library.
The function is executed upon normal program termination. This
patch prohibits executing it twice.

Change-Id: I57289b1ffee97d05709f5c1f961bc39ec98f7d5e
Merge "move main script to main() and remove obsolete pywikibot.stopme()."