pgm 22.4, wc: check for error on file close