Fix occasional record emission failures
Fix occasional record emission failures

This pattern is better because earlier code was vulnerable to
timing bugs. Since recordEmissions is processing messages async.
there was no guarantee that by the time we are asserting emissoinTimes
length it has processed input from channel and removed old emissions.

This code, on other hand - calls recordEmissions syncronously and hence
does not suffer from the problem. Also calling recordEmissions will
block until channel has been read and closed.

qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect