Fix for clang static analyzer issue CWE-119

Switch to `strlcpy` since it is safer to use and remove `strcpy` since it is insecure (although I don't know why unit test code would try to manipulate the buffer, but better safe than sorry).