Update histories simultaneously.

In moveTaskToBackLocked calls that used mHistory were being made
between the times that mTaskHistory and mHistory were modified. This
caused an inconsistent state that led to Windows arranged out of
order. Updating both history stacks at the same time fixes this.

Fixes bug 8244261.

Change-Id: I9669762ad39b06ab6d401122702b74969d4dc658
2 files changed