fix $a.=uniq

The referent of $a is getting clobbered before uniq can get any values
from it.  Wrapping the list in gather/take gives us enough indirection
that we can return a new $a without clobbering the old value.