scheduler: Fix accounting when task ends up in multiple groups
scheduler: Fix accounting when task ends up in multiple groups

Tasks are split between task groups based on common specs. This allows
nodes to only be ranked once per group, not once per task.

This logic doesn't work correctly because maps are marshalled in a
random order. Currently, the same task can end up in a multiple groups
(say, if it's updated multiple times, and the marshalling ends up being
different). To make sure we don't try to schedule the same task twice
within the same batch, use a map for unassignedTasks instead of a linked
list.

Note this doesn't fix the brokenness of task spec deduplication based on
marshalling the protobuf. This is a fix for the symptom that can be
backported, and I'm going to replace the marshalling stuff in a
different PR.

Signed-off-by: Aaron Lehmann <8ecfc6017a87905413dcd7d63696a2a4c351b604@docker.com>

fate-grand-order/swarmkit,cheyang/swarmkit,AliyunContainerService/swarmkit,diogomonica/swarmkit,alyyousuf7/swarmkit,docker/swarmkit,RenaudWasTaken/swarmkit,alyyousuf7/swarmkit,dperny/swarmkit-1,allencloud/swarmkit,elifa/swarmkit,cheyang/swarmkit,jlhawn/swarmkit,docker/swarmkit,sungwonh/swarmkit,jlhawn/swarmkit,AliyunContainerService/swarmkit,RenaudWasTaken/swarmkit,Noyan759/swarmkit,diogomonica/swarmkit,dperny/swarmkit-1,Noyan759/swarmkit,elifa/swarmkit,fate-grand-order/swarmkit,sungwonh/swarmkit,allencloud/swarmkit