Refactor _poll() function.

Completely rewritten. Based on monit's Net_canRead() function.

Signed-off-by: Thiago Farina <tfarina@chromium.org>