fix windows bugs

fixes https://github.com/mitmproxy/mitmproxy/issues/160