Fix uses of HAVE_SYS_TYPES_H in configure.ac itself.
Use AC_REPLACE_FUNCS for strlcpy; this eliminates a ranlib warning on OSX.

Also consolidate two instances of AC_CHECK_FUNCS, and remove an AH_TEMPLATE
left over from the gethostbyname_r cleanup earlier.