g_set_prgname() should be thread-safe
@chergert
Submitted by Christian Hergert Link to original bug (#726742)
Description
Currently, g_set_prgname() is not thread-safe as it could free g_prgname while another thread is holding a pointer to the string.
This is an issue because it prevents GOptionContext from being used more than once in a single process because it calls g_set_prgname().
It would be useful to do so, to implement command-line style applications similar to `git' where parsing of command options could be done multiple times, by multiple commands, in multiple threads.