Replaced the way the client endpoint is created. Instead of doing it when a endpoint is asked,
it is done eagerly. This will hopefully prevent leaking of endpoints of dead connections.