sv.c: Rewrite COW logic

for readability, maintainability, and my sanity.

The comment about swipe and COW having ‘much in common’ notwithstand-
ing (actually they only shared two lines of code), I separated those
two code paths, splitting the horribly complex ‘if’ condition into
two.  I also made the code slightly more repetitive, resulting in
fewer #ifdefs and more clarity.