virttest: Fix network xml sync with state unchanged

When using original sync of NetworkXML class to restore a backup
network, it is redefined and started, leaving autostart disabled.
This is not the default setting (all true for active/persistent/
autostart) for the network.

In this modification, we set the default behavior of sync to
set all state to true. With the help of an optional "state" dict
parameter, we can restore the network to any state you like, or
in practical, to the state we backed up.

To facilitate this backup & restore process, I also added a helper
function state_dict() to retrieve a active/persistent/autostart
dict for backing up current vm state.

The unittest for these network manipulators is given in a new file
instead of libvirt_xml_unittest.py to separate manipulator tests
from XML base test.

Furthermore, the net_state_dict function use an outdated way to get
the persistent property for the network, which is already changed
by a patch (commit 895913d) in libvirt-0.10.2. The persistent status
can be retrieved from net_list directly. So I add a condition to
ensure it can be backported for older libvirt while avoiding
redundant call of net_autostart when testing on new libvirt.

This backport can be removed if old libvirt no longer maintained.

Signed-off-by: Hao Liu <hliu@redhat.com>
@Hao-Liu  I read the network_xml.py and found this change. But I am not quite understand it. In this change, you just recover the state of self. but it does not be defined to affact the *real* network in fact. Maybe I am missing something. But I think it break the original design of sync(). right?

The original design is make the change in self.xml to take effect on real network, then we implement it with undefine/define/start. But now, it seems the all work is only for xml file.

I am still not understanding this change. Could you explain more?