revertbot uses invalid pywikibot.out

Also performs equality between APIError and string, which is brittle.
And silently ignored all other types of APIError.

Change-Id: Idf056b7845c348101bd0033d1f625dff629da49d