schema tree BUGFIX lys_child() on leaf/leaflist

Fixes #341
diff --git a/src/tree_schema.c b/src/tree_schema.c
index 9ceec0f..de4f22b 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -3723,6 +3723,8 @@
             return NULL;
         }
         return (struct lys_node **)pp;
+    } else if (node->nodetype & (LYS_LEAF | LYS_LEAFLIST)) {
+        return NULL;
     } else {
         return (struct lys_node **)&node->child;
     }