Ensure all entities are detached on entity close.

Most likely superfluous.