Simplify configure checks
Autotools has macros that can check for many functions or headers, more efficiently than usual, in one go. We should use them where possible.
Note that these macros are normally only applicable to libc (Standard C runtime library, e.g. glibc or MSVCRT) headers and functions.