fixed bug in client protocol: logout did not work in all cases. fixed missing discard (with client error message) of pending (non sent requests) in case of closed connection (by server or client)