Retry installation commands on Travis CI

As recommended in http://blog.travis-ci.com/2013-05-20-network-timeouts-build-retries/

This should help lessen all the build issues we've seen lately on Travis CI.

cc @jamesls