Perhaps the plug you use for the phones has the 'usual' contact system in which the ground pin is a 'sprung' type. It is probably touching another contact inside the connector when the headphones are unplugged. My suggestion is to buy another male plug, with no wires, and just plug it into the jack when not in use. The easiest fix.
Otherwise you may need to replace the female end of the headphone jack system with a non-contacting type.
I personally would just buy a replacement male headphone jack, Open it and make certain none of the connectors can touch inside, close it up and plug it into the system when not using the headphones.
Otherwise you may need to replace the female end of the headphone jack system with a non-contacting type.
I personally would just buy a replacement male headphone jack, Open it and make certain none of the connectors can touch inside, close it up and plug it into the system when not using the headphones.