Fix array shrinking: we're still talking about pointers, but we do need
to scale down a_size. Also, even if we fail to resize the array, the
value will be removed, so we need to decrement a_len in any case.