Restore tty setup before printing error