Retry connecting to github because sometimes the connection is refused.

I added this code because when I tried to migrate issues the script stopped running after github refused a connection. Only a third of the issues were migrated and it wasn't going to be easy to migrate only the remaining issues. This change makes the script retry when github refuses the connection.