gvariant: Fix a potential memcpy(NULL) call