Mattis’ friends say he quit after more than a year of frustrations both moral and military.