client: on connection, signal the server

This allows the server to notice we've connected and unblock.

Signed-off-by: David Scott <dave.scott@citrix.com>
server: wait for the connection to be established

This means that it is safe to read or write on a connection as soon
as you have the handle.

Related to #24

Signed-off-by: David Scott <dave.scott@citrix.com>
Merge pull request #25 from djs55/test

Partial fixes for #24