Changed to use protobuf_lite rather than full protobuf library.
Use pending count to wait for SetNewParent to finish