Check fclose for errors.