cache refactoring: Use GPtrArray for callable arg cache

Replace manual management of the C array holding individual
argument caches with usage of GPtrArray. This provides storage
of the array length along with item memory management.

https://bugzilla.gnome.org/show_bug.cgi?id=640812