mesh: Fix segfault related to idle config write
If node configuration is completely removed from the system,
remove all pending writes to the configuration file.
Fixes the segfault below:
mesh/cfgmod-server.c:node_reset() Node Reset
mesh/mesh-config-json.c:mesh_config_destroy() Delete node config /var/lib/bluetooth/mesh/
02040d0a060e0a08090b0103070f050c
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/
02040d0a060e0a08090b0103070f050c/rpl/
00000000/0001
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/
02040d0a060e0a08090b0103070f050c/rpl/
00000000
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/
02040d0a060e0a08090b0103070f050c/rpl
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/
02040d0a060e0a08090b0103070f050c/node.json.bak
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/
02040d0a060e0a08090b0103070f050c/node.json
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/
02040d0a060e0a08090b0103070f050c
Segmentation fault
Program terminated with signal SIGSEGV, Segmentation fault.
0x0000563a35df2ed0 in ?? ()
0x00007fd6b131689f in json_object_to_json_string_length (jso=jso@entry=0x563a35dd8d30, flags=flags@entry=2,
Change-Id: Id92320eb3f05f4bda52cff1b6e41c5345bf1df2f
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>