FIX remove reference cycles from Tree
FIX dtype refcount; block resizing after building
Remove 'locked', add comments
Merge pull request #2790 from jnothman/tree_without_cycles

[MRG] Avoid reference cycles in Tree