The British prime minister, Keir Starmer, presented President Trump with a royal invitation and scored several political wins. But his top goal — a security guarantee for Ukraine — remained elusive.