Multiple class events for the same data type causes 0-length object group

When multiple events are queued up for an object group, where the events
themselves are part of different DNP3 classes (1/2/3), the iterator loop
in ResponseContext::LoadEvents<T>() was causing a 0-length object group
to be added to the APDU.

ResponseContext::IterateIndexed<T>() appears to be writing everything in
one iteration.  The iterator loop needs to be bound on both the queue
size _and_ whether any elements are remaining.
Merge branch 'zero-len-group-squashed'