Fix Windows build
This fixes building for Windows using MSYS2/UCRT64 with
meson setup --buildtype=release --wrap-mode=nodownload build
(cd build && meson compile)
The included commits were taken from https://github.com/kjliew/qemu-3dfx/blob/950d43d724fc7cb454dce5fa679b38866b4a3aff/virgil3d/MINGW-packages/0001-Virglrenderer-on-Windows-and-macOS.patch which is licensed under GNU General Public License v2.0 (https://github.com/kjliew/qemu-3dfx/blob/950d43d724fc7cb454dce5fa679b38866b4a3aff/LICENSE)
Fixes #475 (closed)