Use poll instead of a while(1)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>