Check that the pwd command acutally returned a path

Sometimes `run-as` command to get the `pwd` could fail and return an
error message instead of a path. We treated all non-empty strings as
valid paths and this led to strange error later on when the path was
passed to the next shell command. This Cl adds a simple check to see if
the returned string is a path.

Bug: 354945018
Test: cts run JvmtiHost
Flag: TEST_ONLY
Change-Id: Ife15de222dbdff08062526b7ad9c14bd25977782
1 file changed