Fix a race condition in the history initialisation code.

At starts-up, history facilities will be created for every single folder
in the history directory for different devices. A race condition emerges
when history facilities for child href and parent href co-exist, e.g.,

M1.MESN.MsbA
M1.MESN

Dots in the folder names are converted to slashes to support a hierarchy
structure in the history service. If "M1.MESN.MsbA" folder is handled first,
then the XML node with below href

/obix/historyService/histories/M1/MESN/

will be automatically created so that a sub node with relative href "MsbA"
can be added under it. Later when processing the "M1.MESN" folder another
node with the same above parent href will be inserted again.

Obviously, history XML nodes should not be added unconditionally. Moreover,
automatically generated history XML nodes must be copied from the history
stub template so as to be consistent with those nodes created as response
to the history.Get operation.

Signed-off-by: Qingtao Cao <harry.cao@nextdc.com>