Close open files in IO instances