dictionary REFACTOR unify functions pattern to return LY_ERR

Change API functions manipulating with libyang dictionary to return
LY_ERR value as a primary indicator of the result and the value from the
dictionary is returned via optional output parameter.
diff --git a/src/printer_xml.c b/src/printer_xml.c
index 1fc29e4..21d8dc5 100644
--- a/src/printer_xml.c
+++ b/src/printer_xml.c
@@ -93,7 +93,7 @@
 
     /* and added into namespaces */
     if (new_prefix) {
-        new_prefix = lydict_insert(ctx->ctx, new_prefix, 0);
+        LY_CHECK_RET(lydict_insert(ctx->ctx, new_prefix, 0, &new_prefix), NULL);
     }
     LY_CHECK_RET(ly_set_add(&ctx->prefix, (void *)new_prefix, LY_SET_OPT_USEASLIST, NULL), NULL);
     LY_CHECK_RET(ly_set_add(&ctx->ns, (void *)ns, LY_SET_OPT_USEASLIST, &i), NULL);