Wrap travis_retry around pip commands

Sometimes there are network glitches which cause `pip` to fail with the
message `Connection reset by peer`. If we wrap `pip` commands with
`travis_retry`, these commands will be tried up to three times before
causing a build failure.

See <http://docs.travis-ci.com/user/build-timeouts/>.