A try to solve timeouts on TCP sockets

If network connection is interrupted, LDAP library hangs up for internal system timeout (70 something seconds) which is too long for interactive applications. This is a possible draft of solution, however now the time bottleneck is on address resolution which hangs after ~10 seconds.