To be perfectly honest they should have just merged their handheld and console divisions 3 years ago - before the launch of the 3DS. Simply put, I think they're going to have to weather a storm this generation and hold on tight until the next.
Unless of course, they're able to push out a new operating system which unifies the 3DS and Wii U OSes - but honestly that's going to take at least a couple of years and quite frankly they're better allocating those resources to the next generation. While their Wii U and 3DS systems aren't doomed from the get go, they'll be facing some stiff competition from Sony and Microsoft, as well as the tablet/smartphone crowd for the next few years. Unfortunately, in the next couple of years smartphones will completely overlap the 3DS in terms of horsepower and perhaps even in terms of gaming practicality. Someone releasing a 4.5" or 5" smartphone, running android, that's been built from the ground up to work with a gaming controller peripheral, with enough marketing behind it, would make a serious play for a handheld gaming crown. Infact, we're almost there already
What Nintendo needs to do, ideally, is take a look with what Microsoft is doing with Windows Phone 8, Windows RT and Windows 8 - they share a runtime environment (WinRT) and the same kernel (Windows NT), which significantly helps out developers both porting games, and allowing cross platform play, but it can run on multiple hardware architectures. Even on a superficial level they're very similar, both implementing a tiled interface and using live tiles, albeit in slightly different manners. Nintendo have started to do this already, with the 3DS and Wii U looking similar, but different, in terms of their interfaces. But now they need to go the whole hog and unify the whole lot. This should also happen in terms of their accounts, one account spanning multiple devices just like Sony does with the PSP, PS3, PS4 and PSV, not to mention their Android range.
While in terms of downloadable games (made from the ground up for their respective platforms) I don't feel it should be buy once, play anywhere (for example, if they made Geometry Wars for 3DS and Wii U, I don't see why you should be entitled to buy it once and play on both devices), with a unified account they should be able to allow developers to do that if they wish; That being said, I feel Virtual Console purchases should be tied to the account, not the device. At the very best, getting gamers to pay 20p (or 30c, whatever) towards getting their VC game on their device. Of course, having a unified run time environment will make porting easier, there is of course some testing to do for emulators on different handhelds which should be respected - but not respected so much that they would force gamers to repay the whole price of their game they purchased on their older device.
As I said, I don't see this happening on this generation but I sincerely hope it happens on the next, otherwise Nintendo really do have a big chance of falling behind completely. In an age where smartphones are becoming increasingly more powerful year on year, and ecosystems are not only maturing in terms of their features, portability and size, but also in their weight as a significant (if not the most important) unique selling point in a company's arsenal, Nintendo need to shape up. The thing to take note of, though, is if Nintendo does wake up and smell the coffee, everyone has to be scared, as their gaming portfolio literally dwarfs everyone's, and an ecosystem that's got Nintendo's wealth of IPs and franchises is not one to take lightly.