Replace all the calls to unportable strlcpy with more generic things

This limits the dependency of this code with libbsd.