Duplicates a string. If @str is NULL it returns NULL.
NULL
a newly-allocated copy of @str
the string to duplicate