generate_packets.py: detect and forbid cyclic type aliases
Depends on #45178. Also has the side effect of inlining type alias definitions where possible (i.e. if they're defined in the right order), which probably isn't a noticeable improvement to type alias resolution, but still.
Part of #43927. Should likely use #45178. Detect the creation of type alias cycles while parsing them and immediately raise an error.