WASHINGTON — President-elect Donald J. Trump has settled on Gen. John F. Kelly, a retired four-star Marine general whose son was killed in combat in Afghanistan, as his choice for secretary of Homeland Security, putting a seasoned commander with personal experience of the costs of war in charge of protecting the nation’s borders.