Socket functionality for WindowsPoller

Current state of the Windows port: all tests in common/ pass
I wanted to introduce a new scope for local variables. But this file is currently undergoing a massive rewrite anyway ;-)