Are they USB headphones? lol.
That is really odd. It sounds like maybe there is a short somewhere that is causing the kernel panic somehow. You may want to get that check out.
Take it to an Apple Store, or certified repair center. Make sure you can easily recreate the problem. Good luck.