more cleanups around waitpid

Change-Id: Iad8cd1c6847641a7538614e9ff3c375f7af81c63