Just to add to that, as long as China thinks they can control North Korea and they have the skin in the game, I think China's long-term goal is to keep North Korea around as long as possible, for the very reason Marius mentioned, which is the fact that they don't want a hostile neighbour on their border, namely South Korea, or a unified Korea in this case.
Look at China. They're surrounded by hostile neighbours, and they're right in the middle, hence the “Middle Kingdom”.