Prefer g_clear_object to g_object_unref.
Prefer g_clear_object to g_object_unref.

g_clear_object is safer because it NULLs out the reference to the object
being unreffed, and the performance penalty is miniscule.

[endlessm/eos-sdk#2906]

endlessm/eos-metrics,endlessm/eos-metrics,endlessm/eos-metrics,endlessm/eos-metrics,endlessm/eos-metrics,endlessm/eos-metrics