We must link to ws2_32.lib for all Windows builds, and we need to use
workarounds for alloca() and snprintf() since Visual Studio uses
_alloca() for alloca() and provides snprintf() only on Visual Studio
2015 or later, meaning that we need to use _snprintf() here.
Also fix the parts where we run the Python scripts to generate items,
since those scripts already have shebang lines for Meson to pick up.