Add retries to install scripts

This'll retry install script three times before actually failing. Useful
if there are network timeouts or similar issues (see #1089 and #1077).
Merge pull request #104 from travis-ci/hh-add-retry

Add retries to install scripts