dumpstate: fix race in waitpid_with_timeout()

If the child process exits fast enough, then sigtimedwait will never
get a signal and never actually call waitpid. Check to see if the
child process has already died before calling sigtimedwait.

Test: dumpstate_test
Bug: 215574756
Change-Id: I5d0fa5d537e502b2a8254f8d6ba218f3f7161229
1 file changed