Close and restore stdout and stderr