Fix non-deterministic logging of unmatched DNS msgs, addresses BIT-1153

Unmatched DNS messages may fail to be logged sometimes due to a type of
iterator invalidation.
Merge remote-tracking branch 'origin/topic/jsiwek/bit-1153'

* origin/topic/jsiwek/bit-1153:
  Fix non-deterministic logging of unmatched DNS msgs, addresses BIT-1153

BIT-1153 #merged