Strange that it does not work for you. QgsDebugMsg() reliably sends all the output to stderr according to my experience.

However, I assume this message will be interesting also for people developing plugins?
You could use the QgsMessageLog which will also be available in release versions, so plugin devs using release versions also get the messages.