Made handling of client error more robust, avoiding
IllegalStateExceptions when trying to complete the response.