tests: Convert g_free to g_autofree macro in test-logging.c