suppress error message when stdout closed prematurly