Added errorStream null check in HttpClient (used for testing purpose)