His rapid lung cancer diagnosis ended his life after a swift decline that drew widespread tributes to his defense of civil liberties.