Fix invalid timeout for poll().

Fixes #5963