adjust find-next-outer-paren to avoid editing the buffer

related to PR 13454