Probably not what you want to hear, but I use a hardware solution to the problem. I use an old MOTU Midi Express XT midi interface that I picked up off Ebay for £40 which allows midi messages such as program changes to be filtered out by port. Basically I have it set up to block PC messages on all the output ports except the two my Yamaha MU128 are connected to.