A senior Ukrainian security official offered to quit before President Volodymyr Zelenskiy began a visit to the United States this week, the president’s office said on Friday.