try to end curses session gracefully on SIGSEGV