Detect EOF waiting for user input in xshogi and raw modes, and trigger exit.