Lookup an object that represents a tree entry.
buffer that receives a pointer to the object (which must be freed by the caller)
root object that can be peeled to a tree
relative path from the root object to the desired object
type of object desired
0 on success, or an error code