Set the number of events to delete correctly

The code was only freeing up to 20 or so events, depending on how many particles the last non-visible event had.  Correctly setting the index to delete-up-to to be the highest non-visible event.