President-elect Donald J. Trump’s pick to lead the Defense Department was described by peers as a skillful soldier who became embittered by military dysfunction.