Close files before trying to delete them (for Windows)