Refactor RestartSystemUi to use reduce flakiness

The restart logic has been extracted and now uses `ensureThat`.
Added a check after swipeUp for lockscreen not visible anymore.

SysuiRestarted has been created as CommonUtils used the old uiautomator version, and had many other classes have deps on it, so changing to the androidx version of uiautomator in place would be difficult.

Bug: 261552873
Bug: 262588714
Test: presubmits
Change-Id: Ife43b8d61476eeaf2d628547c3e1ef1d034959f5
3 files changed