Before this change, in case when duplicated entries were present, the
code reused the freed NODE structure after the centry NODE structure was
freed in addchild(). To fix this, addchild() now returns either the input
argument or the pointer to the existing NODE structure.
Sponsored by: Juniper Networks, Inc.