Resolved the ClientEndpoint memory leak.

[edit] Don't merge yet. I need to have a talk with @mdogan and @gurbuzali if it can be done in a cleaner way.

The ClientEndpoints are now created when the authentication is done instead
of creating lazily, because with this approach it is possible that an endpoint
of a dead connection is recreated after it has been removed. And this can lead
to a memory leak.