Wait for handshake from remote connection

Signed-off-by: Paul Brook <paul@nowt.org>