Fix loop in poll()

I don't know what exactly I had been smoking.