It turned out that freezing in terror was the right thing to do

No joke, I didn't do anything, just looked ahead, saw I wasn't about to hit anything, and let it get on with it till it sorted itself out. I'm pretty sure if it had got any worse I'd have binned it, but once the rear end untied itself it all settled out, and I rode the rest of the way home at 20mph.