Add request timeouts, and retry failing requests.

Change-Id: Ic0bbba21b0dc139562deae6b69b650f501bf78d0