close the file on termcap loading