autotest: desktopui_ExitOnSupervisedUserCrash race fix

At the end of the desktopui_ExitOnSupervisedUserCrash, I was waiting
for a signal that the user session had ended while accidentally also
causing the UI to get torn down. This resulted in an unclean UI shutdown
that never sent the signal I wanted to see, so the test failed with
a timeout exception.

This change moves the listening for the session termination signal
so we properly wait for it before tearing down the UI.

BUG=chromium:462363
TEST=desktopui_ExitOnSupervisedUserCrash

Change-Id: Ied242e6fe711a78586a356666a73c75d71fb93ad
Previous-Reviewed-on: https://chromium-review.googlesource.com/254710
Trybot-Ready: Chris Masone <cmasone@chromium.org>
(cherry picked from commit 3e5df182dffdaee9c320bded819239e23d9eb16b)
Reviewed-on: https://chromium-review.googlesource.com/254793
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Tested-by: Yuly Novikov <ynovikov@chromium.org>
1 file changed