Joomla stuck at webistall step #1

I just faced a problem with Joomla 2.5 install when the web install get stuck after the 1st step (language selection). After I searched the internet I found a lot of forums describing the same problem. I read a lot of strange ideas about fixing this with different apache and php.ini config changes but none of them helped. In the error log I found the followings:

It seems the  somehow a tcp connection was tried to be opened like a file which can be caused by session.save_handler = files. And this is exactly what I found in libraries/joomla/session/session.php

This change fixed the problem.