Similar thing happened to me the same day outside the break - the mast popped through the top of the sail, and the sail slid down the mast. I've often wondered what I would do if things went wrong.
pweedas and busterwa are absolutely right - hang on to the board for your life! I nearly lost mine while I was stuffing around with the sail.
I de-rigged in the water and eventually managed to put one mast half in each front footstrap and lie on top of the boom, mast base and rolled-up sail. The sail kept catching chop and filling up with water and I had to ditch it. Managed to paddle back with everything else but it was a terrifying experience. You're so far offshore that its hard to tell if you're making progress or being swept out to sea. All in all, the adventure only lasted about an hour, but it felt much longer.
I was lucky enough to bump into a friendly tea bagger from Mauritius who offered to body drag me the last 200m to shore and saved me the indignity of drifting across the slalom course in front of the pub. Fred (or was it Frank?) - thanks, man! Sorry I can't remember you name, I was so exhausted by then. I still owe you a pint.
Things I learned:
1) Don't rely on others. All my mates were on the beach but they had no idea I was in trouble. Another windsurfer said he would keep an eye on me, and then he dissapeared (come to think of it, maybe that was you, mathew?). When I got back to the beach, nobody was aware of any windsurfers in trouble.
2) Make sure the wind and currents will take you back to shore.
3) Don't go far offshore with dodgy old gear.
4) I would have felt a lot safer if I'd had my flares with me, even though I wouldn't have used them.
5) Kite surfers aren't all evil!