Fix unit test failures.
When running tests in Travis and 'gem install' and 'npm install' fail, retry at most 2 more times.

This mitigates most temporary network problems.