Patrol Micro AI: fix bug in the attack part of this MAI

This was an oversight dating back to the introduction of the [filter]
tag as a possible parameter to this Micro AI.  A part of the attack
code still relied on the id= key being given, although that key is not
required any more now.
Move unused script to utils/
workaround for bug #21797

at a certain point in playcampaign.cpp after the level has ended, wesnoth was
grabbing .child("end_level_data"), and writing carry_over sides.
this would cause "mandatory child missing" errors in the test case described.

we fix the error by checking if the child was not present and if so adding it.
however, it may indicate a more fundamental bug involving reloaded games.
Merge branch 'master' of https://github.com/wesnoth/wesnoth