gmain: rework g_get_monotonic_time() a bit