Switch to array doubling algorithm

This allows us to automatically resize the array when an element
or multiple elements are removed with sampgdk_array_remove().