Use AC_USE_SYSTEM_EXTENSIONS in configure

It includes AC_GNU_SOURCE, which is platform specific, thus
AC_USE_SYSTEM_EXTENSIONS is more universal.
Define _XOPEN_SOURCE in Windows Makefile
Remove _XOPEN_SOURCE defines from code

Moved to build system configuration.
Merge branch 'define-xopen_source-globally'

Move it to build systems.