A John Wayne Western classic's ending was changed after a tragic death during filming left director John Ford "completely devastated".