display: Refactor flag animation build code into a separate private method

In order to implement functionality to change a side's flag imageset
after display initialization has taken place, we need to rerun this code
under different conditions.

The refactored code default-initializes the set of flag animations prior
to building them for individual sides; before this change, only the
memory allocation for the set was reserved in advance. Since the first
time init_flags() runs is during display initialization,
default-initializing the set shouldn't really make a noticeable
difference.

Now, we assign the flag animations later over the default-constructed
animations. Hopefully this shouldn't introduce any new interesting bugs.
It's not like there's any code accessing the animations at this point.
display: Implement public reinit_flags_for_side() method

This overwrites an existing flag animation for a side with a rebuilt
one, intended for use after changing a side's flag animation.

It does pretty much the same thing init_flags() does sans vector
allocation and TC configuration, which are supposed to have been done
already.
display: Additional sanity checks in reinit_flags_for_side()
display: Additional assertion checks in init_flags_for_side_internal()
Add set_flag() and set_flag_icon() methods to team class
Implement flag and flag_icon attributes for [modify_side]

Implements the feature request from bug #18454.