async function waitForChildPids(pid) {
  let childPids = [];
  while (!childPids.length) {
    childPids = await pidtree(pid);
    await new Promise(resolve => setTimeout(resolve, 100));
  }
  return childPids;
}
Polls a process for its list of children PIDs. Returns the first non-empty list found
@param {number} pid - Process PID
@returns {number[]} Child PIDs