Close files after completion of each command.