I did the EXACT same thing coming down a long steep hill. I whipped back and forth so hard my shoe released from the pedal! I thought I was dead. I have no idea how I kept from wiping out.
So, my friend, you are not alone.
PS - When I got home I glued the plug into the handle bar (then changed my shorts).