The moment of levity underscored how the two leaders had grown closer during a series of encounters over two days, the South Korean president's spokesman said.