[libc] always clean up child process to avoid hanging ninja (#118049) GitOrigin-RevId: cf478bf744fa2aacb634b151b7f6c9844f0d3851