libs/core: reuse existing uci context in network model if possible. fix some bugs