Ensure info cache updates don't overwhelm cells

Cells does its own healing of the info cache outside
of get_instance_nw_info, so we have double healing
happening if info_cache_cells_update is called for every
get_instance_nw_info. This also overwhelms cells'
ability to keep the global db updated at scale. Similar
functionality exists in nova/network/api.py.

Conflicts:
        nova/network/neutronv2/api.py

NOTE(mriedem): This is due to base_api not existing
until Juno, where the refresh_cache decorator now
lives.

Change-Id: I58f681f3674d826e3dce4fa956e2eb0e4c60f82b
(cherry picked from commit 446d433f6fea7624acae371189239a82c94ad455)
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 "Ensure info cache updates don't overwhelm cells" into stable/icehouse
Merge "Neutron: Atomic update of instance info cache" into stable/icehouse