How (not) to leave class-D amplifier's input hanging
Run resistors from pins 3 and 4 of the headphone jack to ground.  You may need to experiment, but you should be OK with 220\$\Omega\$ or so.  The idea is that when the jack is unplugged, the resistors won't matter (because the class AB amp is used to lower headphone impedances anyway), and when it's it's plugged in the resistors will act to ground the input to the class D amp.

Or look around for a jack that has a separate pair of contacts that opens when a plug is present, and use that to disable the class D amp.