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  Yes, I see the usage of it and I used it in lots of modules. My point here is that you changed the behavior of the method of sync() I think.
Example:
```
net_xml = xxx_dumpxml("default")
change_ip_range(net_xml)
net_xml.sync()
```
In sync():
Before:
          (1).undefine network
          (2). define net_xml
It means the ip range is changed for the default network

Now:
      adapt the states_dict to state. but these all change in net_xml does not affact the real default network.

My point is the method named *sync()* in libvirt_xml module is used to make the change in xml to affact the real device. Such as vmxml.sync(). we are using it like:
```
vmxml = dump_xml("vm")
vmxml.add_device(xxx)
vmxml.sync()
```

Oops !!!!!!!! The accessor of defined/autostart/persistent was overrided in network_xml and thay are so strange.
So it does the actual work when we set the value of them. It means when we set net_xml.defined="yes", it will actually define the network. 

OMG! This break the design of libvirt_xml. Okey. your patch works well. Sorry for my mis here. :( I will talk with chris (maybe others, he is busy with docker) why we should break it in network_xml. 

Anyway, your patch here is okey. Thanx for your reply.