When the HTTP client disconnects or times out, flip the state right away rather than in the cleanup callback