test/driver: Retry fetches after timeout or short read

caching-proxy.py will close a downstream connection if its upstream
connection fails.  Retry the fetch in this case.  Also enforce our own
timeout and retry if it triggers.