Clean shutdown when file processing is in progress