Bug 710989 - Replace most uses of strcpy()

Because strcpy() can overwrite its buffer.  As with the previous
replacement of sprintf(), some of these could probably be replaced by
g_strdup(), but there could be some performance impact.

(cherry picked from commit 61bf9fb860ecb4c6ace37cf3414d68d298ec26cf)