Add signal handler to close files upon CTRL+c