Refactor implementations to hide XMLStreamWriter
In order to have control over when we output an element, we need
to make sure we know how the writer is being used.
Refactor XMLStreamNormalizedNodeStreamWriter interaction with its
subclasses so we know when we are leaking the writer -- which
happens only in writeValue().
JIRA: YANGTOOLS-927
Change-Id: I7e7bd62016e994a31fe6d69995e9d088746359da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
127cfbef06dec06721efc4fafe2e9ab551c644e6)