ClientImpl does not properly store the username during initialization so

the HTTP Client looses track of the connection and clients don't get
cleaned up properly.

Also found and fixed an issue where AuthenticatedConnectionCache was not
locking all refcount manipulations.