Do not attempt to form leaf metadata on empty path
This thinko was introduced during Sodium MRI integration. As
NormalizedNodes no longer hold attributes, the corresponding
metadata needs to be constructed -- but only in the case
we have created the structure ourselves.
In order to fix this, we iterate over both the node and the path,
thus correctly mirroring the structure.
JIRA: NETCONF-613
Change-Id: Ib2c9736c577c5dbdd8f4c826f13acbd7cbc21418
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>