post: close the output device before exiting