[ty] Avoid panic from double inference with missing functional Enum names (#24638)
## Summary
Given `Enum("Color")`, we inferred the first argument, then returned
`None` later if `names_arg` was empty, which led us to double-infer the
first argument.
Closes https://github.com/astral-sh/ty/issues/3272.