close console window if it is open when app closes