Merge changes Ib202fd5c,I5d0fa5d5

* changes:
  dumpstate: improve performance
  dumpstate: fix race in waitpid_with_timeout()