Handle sparql http timeout issue
This is done by catching it, waiting, then trying again. On the second try
the sparql endpoint has already generated the result so the reply is fast.
A proposal for an upstream fix in pywikibot has been made in
https://gerrit.wikimedia.org/r/371697 but this is a stop-gap messure.