meson: check for endian.h instead of assuming __GLIBC__ has it.
This allows building with musl libc which also ships endian.h but does not set the GLIBC macro (because it is not GLIBC). It is always better to check for a feature rather than assume certain implementations have them.
NOTE: this was not tested on platforms other than Alpine Linux (which uses musl libc).