Stop at recursion when checking whether a variant can be undefined
Why
Deciding whether option of a recursive @unboxed variant can be unboxed walked the payload types without remembering the variants it was in, so Recur(t) sent it into t forever and the compiler died with a stack overflow (#9018).
The walk remembers the variant declarations it is in. A variant met again adds no way to be undefined, since a value reaches undefined through finitely many unboxed payloads, so the answer comes from its other cases.
modifiedJS option of a recursive unboxed variant
@unboxed type rec t = Recur(t) | Endlet x: option<t> = Some(End)
js
Before
After
Fatal error: exception Stack overflowlet x = "End";
Fixes #9018