Fix exit status reporting for forked CMD/batch processes