Update get_intermediate_file method to use "with" context to return open file
This puts the returned file open() calls inside a "with..as.." to handle the @contextmanager on the CachePartitionFile.open() method.
It partially addresses this issue -> #957 (closed)
Edited by LeVon Smoker