Don't use g_clear_pointer yet, it's too new.

Do it the old way.