gmessages: Error if g_log_set_writer_func() is called multiple times
Inspired by #2638 (closed).
This requires moving the tests to subprocesses, so that
g_log_set_writer_func()
is only called once per process.
It also adds a test for the new error.
Signed-off-by: Philip Withnall pwithnall@endlessos.org