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/xml.c b/src/xml.c
index 8cb3a8c..7061538 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1111,8 +1111,8 @@
                     }
                     if (!p) {
                         LY_ARRAY_NEW_GOTO(xmlctx->ctx, prefixes, p, ret, error);
-                        p->id = lydict_insert(xmlctx->ctx, start, len);
-                        p->module_ns = lydict_insert(xmlctx->ctx, ns->uri, 0);
+                        LY_CHECK_GOTO(ret = lydict_insert(xmlctx->ctx, start, len, &p->id), error);
+                        LY_CHECK_GOTO(ret = lydict_insert(xmlctx->ctx, ns->uri, 0, &p->module_ns), error);
                     } /* else the prefix already present */
                 }
             }