fix terminal size detection in mintty

use try catch and open from t.in_stream