Fixing a race condition between opening a file's metadata and copying the file's data.