ncm-named: fix retrieval of named root directory from sysconfig

Fixes #241

Wait for more unit tests to be added before merging this PR.
cancel just set a flag saying that at close() time, the modifications must not be saved. This is why I call cancel() just after opening the file.