Non-blocking check for stop.

Makes it so a the previously blocking read (now IO#select and
Native#poll) timesout after 1 second and checks for the stop
flags.