Add locking to _NetworkQuery
Add locking to _NetworkQuery

Make use of _GetNames() to get the final network UUIDs.
Get networks info after having aquired the locks. Refactor
the code to use new local variables:

 - "network_uuids" returned from _GetNames()
 - "all_networks" that are the latest network info
 - "name_to_uuid" used for getting network UUID out of NIC's network

Signed-off-by: Dimitris Aragiorgis <4514117c4a99256e19437c7e3407c4ecbf98aec0@grnet.gr>
Signed-off-by: Michael Hanselmann <68b67885ff74281219b4a4be33cc20fd45078d7c@google.com>
Reviewed-by: Michael Hanselmann <68b67885ff74281219b4a4be33cc20fd45078d7c@google.com>

apyrgio/snf-ganeti,andir/ganeti,dimara/ganeti,dimara/ganeti,ganeti/ganeti,apyrgio/ganeti,leshchevds/ganeti,leshchevds/ganeti,ganeti/ganeti,onponomarev/ganeti,grnet/snf-ganeti,onponomarev/ganeti,ganeti-github-testing/ganeti-test-1,yiannist/ganeti,bitemyapp/ganeti,andir/ganeti,andir/ganeti,apyrgio/snf-ganeti,ganeti-github-testing/ganeti-test-1,apyrgio/ganeti,ganeti/ganeti,yiannist/ganeti,mbakke/ganeti,mbakke/ganeti,yiannist/ganeti,bitemyapp/ganeti,grnet/snf-ganeti,leshchevds/ganeti,mbakke/ganeti