Write "close" to the socket on disconnect

Signed-off-by: John Else <john.else@citrix.com>
Rename "disconnect" to "close"

This is consistent with the actual message sent when closing the
connection.

Signed-off-by: John Else <john.else@citrix.com>