RingBuffer: clear the elements array when discarding objects.

Just to avoid keeping around references when the caller has already
been clear that the contents of the buffer are no longer relevant.