Fix some more bugs in libsmbclient.c and add functionality to tree.c