US Defence Secretary Jim Mattis has reacted to North Korea's latest nuclear test by saying threats to the United States and its allies "will be met with a massive military response".