generate_packets.py: Parse packet flags in one go
Part of #43927. Current packet flag parsing searches through a list to find specific flags and remove them. Replace this with a single loop going over the flags (same as field flag parsing).
Part of #43927. Current packet flag parsing searches through a list to find specific flags and remove them. Replace this with a single loop going over the flags (same as field flag parsing).