Fix off by one errors with darray end variable

There was a problem with darray_push, it assumes that variable `end` is
the next index which is empty, but if one where to mix using both
darray_set and darray_push, then the indexing can get messed up. i.e.

    darray_set(some_darry, i, some_el);
    # end in this case will be i (provided i is larger than previous)

    # then if we use darray_push later in the code like so
    darray_push(some_darray, i, some_el);
    # end is no longer i like in set! it is now i + 1
    # which can be a problem

So the moral of the story here is never mix darray_set and darray_push
in your client code!