Gracefully save and load curses state when dropping to shell