[cpp] Only throw KeyboardInterrupt when SIGINT is not trapped