North Korea has carried out its first underwater missile tests in nearly three years, firing two strategic cruise missiles, state media said.