Re-set profile owner and wait for success

The shell command "dpm set-profile-owner" might not success or the
operation is still in progress. In this case, sleep a bit and then
retry.

Bug: 197915650
Test: atest CtsAdminTestCases:android.admin.cts.DevicePolicyManagerTest
Change-Id: Ic0d78cca4caa9f9ee526a246160f71ab1dcc8c4d
Merged-In: Id5aee739db503918fad25626f6d4b3d71335e108
2 files changed