Avoid HEAD requests for files missing from the destination

Change-Id: I8a3d2ddeb650c800d1e4af144d5cd2cb23cd8744
Merge "Avoid HEAD requests for files missing from the destination"