Fix builtin check in has_function() with GCC 10 on Windows
Fix builtin check in has_function() with GCC 10 on Windows

The builtin check had a special case that if a header was provided and
the function wasn't defined, it would ignore the builtin to avoid
non-functional builtins (for example __builtin_posix_memalign in MSYS2).

GCC 10 gained support for __has_builtin() which now skipps this check
and because __has_builtin(__builtin_posix_memalign) returns true the
non functional builtin is now reported as available.

To get the old behaviour back move the special case in front of the actual
availability check.

Fixes #7113

becm/meson,jpakkane/meson,pexip/meson,jpakkane/meson,pexip/meson,pexip/meson,mesonbuild/meson,becm/meson,QuLogic/meson,jpakkane/meson,mesonbuild/meson,pexip/meson,becm/meson,becm/meson,QuLogic/meson,QuLogic/meson,mesonbuild/meson,mesonbuild/meson,jpakkane/meson,pexip/meson,QuLogic/meson,mesonbuild/meson,jpakkane/meson,pexip/meson,becm/meson,QuLogic/meson,QuLogic/meson,QuLogic/meson,mesonbuild/meson,pexip/meson,jpakkane/meson,jpakkane/meson,mesonbuild/meson,jpakkane/meson,mesonbuild/meson,becm/meson,QuLogic/meson,becm/meson,jpakkane/meson,becm/meson,mesonbuild/meson,pexip/meson,becm/meson,becm/meson,pexip/meson,pexip/meson,QuLogic/meson,mesonbuild/meson