Fix data/greeting race condition (w/testcase).


The greeting event will not be seen by a client if the first data event on the stream arrives before the client starts listening.

This bug is easily reproducible (for example, set a timeout before listening to 'greeting'). Patch includes testcase.