As Gen. Milley steps down as chairman, his work on Ukraine is just one part of a complicated legacy