It's pretty much the same technique as smoking in bed.
But you could always wrap some duct tape around your head to provide some strain relief on the earbud wires and keep them in your ear.
BTW, you never did mention how they break. Is that lack of information simply to keep getting answers? We have a word for that, y'know.