unit death fails when effects active
issue #1398 (closed)
the problem was that the code to check for outstanding effects belonging to the soon to be deceased unit was written in such a way that it could crash. this PR re-writes that code (and its neighbor) to be cleaner and more fault-tolerant.