Shutdown correction + corrected 40x response code handling

Two changes that I've needed for my instance:

a) code to shutdown the Async client correctly;
b) code to handle 401 (and other 40x response codes without entities) without failing, and being able to communicate the actual error response code back to the caller