win32: simulate control_pipe with socket

Use event to clean up and exit gracefully