Make it possible to disconnect

There is no way to disconnect from the remote host once the connection
has been established. Add a method that shuts down the connection.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
Implement support for the logout command

We now have support for closing the connection to the remote host. This
allows us to implement support for the logout command, which once
completed should disconnect.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>