Fix GenEvent stream leaking messages

Previously messages could leak from a GenEvent stream because it did not
wait for the forwarding of events to stop before flushing its message
queue.