Retry git commands

We should retry `git submodule` and other commands.

This addresses travis-ci/travis-ci#2061.