The chairman of the Joint Chiefs of Staff has written an unusual letter reminding all those in uniform to stay out of political debate.