client: expired X-Auth-Token can cause [errno 32] Broken pipe

Made the re-auth/retry flow:

1) try to re-auth even though the HTTP 401 exception was not the first
exception raised.
2) try to re-auth on more general socket errors instead of only 401.