Avoid NullReferenceException when request times out

The diff looks bigger but the actual change is in 
- wrapping the tests on exception type to flow-controlling loop and
- testing the response on null (with possible break to continuation code)

I also have suspicion that there is missing 'return' when exception is AuthenticationException but did'nt fix as not sure about the purpose.