Refactor proxy basic authentication handling to only send authorization if challenged by the proxy server.