replace malloc(strlen())/strlcpy with strdup

clang complains that we are using len(src) as the length field for
strlcpy. Note that this is just an open-coded strdup anyway.