I don't know if it's detrimental or not to swallow mucus. Probably not, but what I do now- I use a small tub, like one that hummus comes in, and spit into that if anything comes up. At the end of the fast, I just pop the lid on and throw it away. I feel better expelling the stuff that is coming out of me, rather than swallowing it back down. You can always wash the residue away every few hours if there is a lot.
e2a- the stuff is coming up and out for a reason, so it is probably better to spit it out. But I doubt it matters greatly if you swallow some back down.