windows: fix handling closed socket while poll handle is closing

fixes #1278