I have resolved the problem. I have added the following parameter to each request:
request.KeepAlive = true;
Moreover, I have set the Content-type of log out request to null:
connectionService.ContentType = null;
var logOutResponse = connectionService.DoGet(logOutUri, cookies);
Now everything works fine.