Use ptr_list instead of ptr_deque for SchedulingGroup::WorkQueue.

Using ptr_deque causes problems when splitting the WorkQueue as
iterators get invalidated. Specific problem was that tranferring
the last element of a ptr_deque to another ptr_deque caused the
end() iterator for the first ptr_deque to change, thus breaking
the traversal logic.

Add unit tests for WorkQueue split and merge.