pids fix a race in pid generation