data tree BUGFIX change how hash matching is performed

Hash matching now works strictly based on
hashes meaning that leaves/any nodes values are not
compared by the val_equal hash table callback.

Fixes #1148
diff --git a/src/tree_data_hash.c b/src/tree_data_hash.c
index ee7855b..5ebe120 100644
--- a/src/tree_data_hash.c
+++ b/src/tree_data_hash.c
@@ -116,11 +116,16 @@
         }
     }
 
-    if (!lyd_compare(val1, val2, 0)) {
+    if (val1->schema->nodetype & (LYS_LIST | LYS_LEAFLIST)) {
+        /* match on exact instance */
+        if (!lyd_compare(val1, val2, 0)) {
+            return 1;
+        }
+    } else if (val1->schema == val2->schema) {
+        /* just schema match */
         return 1;
-    } else {
-        return 0;
     }
+    return 0;
 }
 
 LY_ERR