Fix several edge cases where dhcp and static ip and dns settings weren't handled correctly on Windows.