tests: refactor running glib-mkenums
tests: refactor running glib-mkenums

Part of runMkenumsWithHeader() was duplicated in test_reproducible(),
and would otherwise need to be duplicated again in upcoming tests.  Many
places duplicated decoding stdout/stderr and checking the exit code.

Introduce a named tuple for the returned fields; and factor out writing
a template file to pass with --template.

endlessm/glib,endlessm/glib,endlessm/glib,endlessm/glib,endlessm/glib