Issue #26801: shutil.get_terminal_size() now handles the case of stdout is
reopened on Windows.  Added tests for fallbacks.