Account retries on ProxyError

Current implementation fails if it encounters a proxy error no
matter how many retries left.

Change the behaviour to try connecting until retry limit has reached
and then throw an appropriate exception: ProxyError or MaxRetryError.