Prevent race condition in the kill command
Prevent race condition in the kill command

When killing views with `close_views` a use-after-free can sometimes
occur because parent views are killed before their children. This commit
makes `container_map` run functions on child containers before their
parent, fixing the race.

Fixes #1302

ascent12/sway,taiyu-len/sway,johalun/sway,4e554c4c/sway,1ace/sway,1ace/sway,ascent12/sway,ptMuta/sway,taiyu-len/sway,4e554c4c/sway,SirCmpwn/sway,ascent12/sway,taiyu-len/sway,1ace/sway