BZ1034030 : 0 byte local cache file in UrlResource

This fix defers cache file update until completely reading InputStream. So the "0 byte" risk would be minimized.