clean up DSEmpty and have it support "stop"
clarify some confusing behavior for "delete: true"
fix variety of race conditions in t.node deletion

fixes T51496

this should prevent child-node counts from becoming arbitrarily
negative numbers, being unable to re-create nodes that had been
previously deleted, and possibly other strange behavior.