Fix valgrind errors caused by node list.

- Fixed so that it free the node's internal data's children list when the node
is released.
- Attach internal node has been modified to initialize the node's internal data's
children list if alloc is 0.