As far as China is concerned, defending NK is defending itself, which was the rationale for its involvement in Korea War. 

If U.S. could promise it  would withdraw its military presence from Korea peninsular; and if other countries could take in part of the refugee crisis once NK government collapses. 

It is a substantiated fear to China that US would establish the military base right along the border between China and Korea should the NK government be taken down. 

NK is a new form of the Great Wall for China now....