run-command: factor out child_process_clear()