Close dangling snapshots and streams in ResponseCacheMiddleware.

Change-Id: Ibf3ba8e1e35b6a2926ec55c6781debda949c29ae