Use g_array_unref when done with attribute array

It's not necessary to call g_array_free when we're done with the
attribute array. We can just call g_array_unref which does the same
thing but also works with reference counting, just in case we ever have
other references to the array.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>