set various glibc flags that also are useful with mingw

for example, asprintf/vasprintf are unmasked with _GNU_SOURCE in mingw