Fix attribute namespace lookup
During review process of Id214b78849998cf54e087685dcc78e3ded74ab69
we have broken writeAttributes() in the sense it is now sensitive
to attribute namespaces not hahving a prefix assigned in the writer.
Attributes are seldom used, but NETCONF uses them without emitting
them in the writer, hence the codec is not a drop-in replacement.
Add back the ability to map attributes, but also emit a warning if
the caller has not set up the namespace. The warning is emitted
only once for each namespace.
Also modify RandomPrefix to consult the NamespaceContext for already
existing prefix mappings.
Change-Id: Iaffcbfde06b7dffbf6e6ed02c0ba7d73fd053d6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>