This is sort-of a hack/approximation, but it works.
Rationale: poll_oneoff is expected to return immediately if there
isn't any input ready.
When the fd is `stdin`, the input either is there
or it is not; i.e. if you are expecting interactive input,
then you probably want to do a blocking read(), otherwise
poll would immediately return with an answer: there is no data.
If indeed there is data, then it means you are not doing
interactive input, but piping it into your stdin.
Thus, platform.isTerminal(fd) gives you the right answer.
However, fd=0,1,2 is not a valid value on Windows, so
we fix the implementation for that platform, and there we go.
I assume this to be a temporary fix, before we do implement
poll_oneoff properly, but for now it is good enough.
As a test, I updated the test for poll so that
the result type is consistent with the state of os.Stdin
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>