re-use correlationId as key for outstanding requests

Instead of keeping track of a separate identifier for outstanding
requests, re-use the correlation id since it is echoed back in the
request handler.
unify cleanup on session termination

This change consolidates similar functionality that was duplicated with
slight variations.  Now, the code path has the same generic structure
with the different functionality confined to their own respective
callbacks.
echo an extra newline in example/ex1.sh

At the end of the example, the extra newlines ensure that your command
prompt displays properly.
assert invariant that the expected correlation id exists for dispatching