tests: Initialize Windows Sockets where needed

Fixes failing test cases on Windows.
2 jobs for windows-test-fixes in 1 minute and 44 seconds (queued for 29 seconds)
Status Job ID Name Coverage
  Build
passed #66992
build autotools

00:00:54

passed #66993
build meson

00:01:35