fix terminal size detection in mintty

use try catch and open from t.out_stream