configure: Move newlib libc check before mingw libc check

On Cygwin systems MinGW headers can be present if the corresponding
packages have been installed. Since the MinGW libc is checked for
first, this results in newlib getting misdetected as MinGW libc.
