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>