w32: Fix regression caused by new g_poll implementation

Commit 5a007547df76446ab891df93ebc55749716609bf tried to fix a
performance degradation caused by bad handling of small timeouts
in the original implementation of g_poll.

Since that commit, hard disk I/O no longer works.

Instead of rewriting the g_poll implementation, this patch simply copies
the original code (released under LGPL) from latest glib and only modifies
it where needed (see comments in the code). URL of the original code:
https://git.gnome.org/browse/glib/tree/glib/gpoll.c

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1401291744-14314-1-git-send-email-sw@weilnetz.de
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>