North Korea fired a ballistic missile from the sea on Wednesday, South Korea’s military said, a suggestion that it may have tested an underwater-launched missile for the first time in three years ahead of a resumption of nuclear talks with the United States this weekend.