Apply the previously added spatch/coccinell file to replace all
free/malloc/realloc calls with g_free/g_malloc/g_realloc. It also removes
all the error code paths that we do not need to check anymore.
This means that the returned data must be free'ed using g_free rather
than free, making memory management more consistent.