Start activity from top z-order when attaching process

The order of start process request may not be the same as hierarchy
z-order. E.g. when moving a task with 2 translucent activities
which belong to the same dead process, the top activity will request
first. And then ensure-visibility may be called from completePaused
of previous activity, then the bottom activity will also request to
start. And if realStartActivityLocked is called for the bottom activity,
the ensureVisibilityAndConfig in realStartActivityLocked will make top
activity create with deferResume=true, which causes to miss top resumed
(no wm_on_top_resumed_gained_called).

Also make WindowContainer#compareTo safer, which allows to compare
container without parent. The result is still valid by tracing the
parent and index.

Bug: 352423986
Flag: EXEMPT bugfix
Test: RootWindowContainerTests#testAttachApplication
Change-Id: Iabccb9fd0cd2260d803756dc4cd0b7613b11a7fb
4 files changed