Fix things so that array_agg_finalfn does not modify or free its input