gsmi: fix null-deref in gsmi_get_variable