Move support code to its own function.

zunionCloneAndFree is a new function which does as it says. It will
clone a ZSET and free the old copy. This is good for resorting a ZSET
in case it's values were directly modified.