test: test that closing a poll handle doesn't corrupt the stack

This is a regression test for an issue that was originally reported
in https://github.com/libuv/libuv/pull/36, and fixed in cd89452.

PR-URL: https://github.com/libuv/libuv/pull/48
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
win: fix compilation of tests

PR-URL: https://github.com/libuv/libuv/pull/51
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Revert "win: keep a reference to AFD_POLL_INFO in cancel poll"

The offending patch doesn't completely fix the issue, it just trades
stack corruption for heap corruption which is less likely.

In addition there is a much simpler solution for this problem.

This reverts commit cd894521dd9e1e648fde803950f2dcb3a8529a3b.

PR-URL: https://github.com/libuv/libuv/pull/49
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Marc Schlaich <marc.schlaich@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
win: avoid stack corruption when closing a poll handle

When the user closes an uv_poll_t handle, there may still be an
outstanding AFD_POLL request. Libuv can't cancel this AFD_POLL request
directly, so it has to submit another which makes the the previous
poll request return.

Libuv completely forgets about the "canceling" AFD_POLL request, but
at some point in time it may complete and store its result somewhere in
memory.

Without this patch the result of the canceling poll request is written
somewhere on the stack, which sometimes causes stack corruption. This
patch ensures that the result is written to some static scratch space
where it can do no harm.

PR-URL: https://github.com/libuv/libuv/pull/49
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Marc Schlaich <marc.schlaich@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Merge branch 'v0.10' into v1.x

Conflicts:
	src/win/poll.c
	test/test-poll-close-doesnt-corrupt-stack.c