Do replacements in memory if a file is in the working set but not yet open

For #8160. @peterflynn