strfuncs: add g_set_str()
This is like our other suite of g_set_*() based APIs to simplify and improve correctness of setters for fields, properties, and more.
This implementation specifically handles setting string values that may point to an offset within the current string by copying before free.
strcmp() is used directly (as opposed to g_strcmp0() due to it being in gtestutils.h as well as to increase the chance that the compiler will hoist the implementation.
Fixes #2747 (closed)