manually close stdout