Clean up some chan_zap code to make it more readable. (issue #6834 reported by ppyy)