call endwin() only on resize