Gracefully restore the CLI cursor on exit