PYTHON-732 Test network error during authentication.

As hoped, rewriting the error-handling code to use context managers
(PYTHON-722) has already fixed PYTHON-732 in the 3.0-dev branch.