I just figured it out. It seems pretty counter intuitive, but works correctly.
You have to go into the advanced options.
Then select "Make front and rear output playback two different audio streams".
And presto. If you make the headphones your default device, then when you unplug the headphones windows falls back to the rear panel for audio.