Neutron: Atomic update of instance info cache

In the Neutron network API implementation, there is a race condition
between a thread performing periodic task to read and heal instance
network info cache and another thread servicing interface-attach or
interface-detach calls. This patch ensures that instance info cache is
read and then updated in a synchronized block to ensure atomicity.

Please see the bug report for more details.

Conflicts:
        nova/network/base_api.py
        nova/network/neutronv2/api.py
        nova/tests/network/test_neutronv2.py

NOTE(mriedem): Notes on conflicts:

1. base_api didn't exist until Juno so that's where refresh_cache
   lives now.
2. nova.network.neutronv2.api is using oslo.i18n in Juno rather
   than the old gettextutils import.
3. test_neutronv2 didn't start using mock until Juno and the change
   that added the test class is probably something that we won't
   be backporting, so the test class definition is brought back
   with this change for the new test case.

Change-Id: Ifc76f2b1cce834b3c9927359ac9b957bc9f9c65f
Closes-Bug: #1326183
Co-Authored-By: Dan Smith <dansmith@redhat.com>
(cherry picked from commit 232cbfe67ffb7696f115830c711a960af5fa0828)
Merge "Neutron: Atomic update of instance info cache" into stable/icehouse