unique(AbstractArray, dim): incorporate @timholy's suggestions