[BZ-1034030] 0 byte local cache file in UrlResource

- Stream close and Exception handling in cacheStream()