Bugfix: Changing Task state breaks comparator in ShowQueue

This can happens if you have a long queue and the state of
a task (DONE, CANCELLED, RUNNING, READY, SLEEPING, OTHER)
changes while the sorting is ongoing. The reason this
generates an error is because the Task State defines
the tasks’ place in the queue.

If Task state changes while the sorting of the queue is
ongoing the Comparator violates its contract of:
X<Y, Y<Z => X<Z
and throws:
IllegalArgumentException: Comparison mehtod violates its
general contract!

Fixed this bug by saving a snapshot of the state and delay
of the tasks in a wrapper.
* Introduced interface TaskInfo that is implemented by
  QueueTaskInfo
* Added getTaskInfos method in WorkQueue decoupling it from
  ShowQueue implementation by Interface and factory.

Signed-off-by: Gustaf Lundh <gustaf.lundh@sonymobile.com>
Change-Id: Iea17046aea1b8c6119cfc663438e17f663e05b22
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Bugfix: Changing Task state breaks comparator in ShowQueue

Conflicts:
	gerrit-server/src/main/java/com/google/gerrit/server/git/WorkQueue.java
	gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowQueue.java

Change-Id: I7f5d5484c49a8dfb1e634ad57e28ba13ed3a607d