Marking entities about to be removed, avoiding multiple removal

I've had some weird behavior, as some of my entities got removed multiple times at times.
This code helps to avoid this. I guess you could do this from the users code with flags, but it seems such a basic feature.
Maybe we shouldn't expose this for now. Let's keep it internal. If the user wants to delete, he should just call `removeEntity()`.