Close input and output files in demo program.