Haha, well... problem solved?
If you do happen to get the problem again you can get some kind of audio extension cord (I have one, it came with some DJ headphones that I got ages ago) and then just have it within reach for switching out your headphones and speakers. Or some kind of other solution.