Fix waiting for system server to be running for BootImageProfileTest

In the case where system server was not yet running, the invalid pid
would cause the test to fail instead of doing the 20 retry loop.
Fixed the logic to handle this case.

Presumably fixes test flakyness.

Bug: 143223380
Bug: 139883463
Test: atest ./tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java

Change-Id: I4bac03e7f377058479f75daaa0d57608614bf329
1 file changed