North Korea's admission that it is still working on nuclear weapons is not as bad as it sounds. If used, the prevailing winds would take most of the fallout to Japan and North America.
The North Koreans have always made the Chinese nervous and it's likely that the Chinese knew more about the North Korean nuclear program than they will admit. The Chinese have been leaning on the North Koreans a lot over the last few years and fear of Japan's stealthy rearmament has been part of that. The Japanese could become a nuclear power within a year, and that would not go down well in China.
A nuclear Pakistan is less of a problem, as they are seen as a foil against the Indians. The government does not appear to be worried about the Pakis slipping the Uighurs a nuke. The problem in Xinjiang has more to do with separatism than religion (the Uighurs avoid pork, but consume lots of beer.) Those separatist problems are found along nearly all of China's land borders. The downside of empire.
You've got to admire the North Korean's, though, as they are running the most successful extortion racket in history. But meanwhile, American officials have gone to China to discuss what can be done to deal with North Korea's dangerous behavior.