P51, from what I have been able to find from various comments, letters, manuals, etc, if you couldn't limber up and get the gun to safety, you spiked it and got out of Dodge. Cannoneers fought pretty well unencumbered, no pistols, no rifle muskets ready to hand. Come to think of it, in my browsing through photos of CW cannoneers, I don't recall seeing many with the almost universal waist belt with a belt knife. If you are serving a gun quickly all that junk just gets in the way.
Senior NCOs and officers had side arms mainly to shoot horses that were wounded (and because they looked spiffy). There might be a few musketoons for each gun but not much else. I forget which manual I read it in, but one did specify that there were to be two musketoons for each gun. Maybe more to "put the sker" into skirmishers than anything else. Or maybe to help supliment the company mess. It was the job of the horse soldiers or the poor bloody infantry to keep the enemy away from the guns.
It is fun to make a show of grabbing the trail spike or the worm and making as if to charge the (grumble, grumble) Berdans as they advance on your unloaded gun. And have them shoot you so you die gloriously. I would think that if somehow a gun did get over run by surprise that the cannoneers would fight hand to hand, just like any other soldiers. But how often could the surprise be achieved?