Use Autoconf to check for strlcpy

Autoconf can check for strlcpy. If it finds it without having to use
a library it won't add anything to LIBS. Otherwise it will try
libbsd and if finds it there it will link libbsd.

Use also AC_CHECK_HEADERS to only include bsd/string.h if it actually
exists.