Ensure core plugin deallocation after every test

The unit tests were previously consuming an excessive amount of memory
(4GB+) due to plugin instances persisting in memory.  Deallocation was
not possible where a combination of circular references and mocking
was involved.  This patch ensures that only NeutronManager holds a
plugin reference and that all other references are instances of
weakref.proxy.  Residual memory footprint for tox executed on a
12-core machine has been reduced to ~1.3GB.  Plugin deallocation is
validated at the end of each test to prevent regressions.

This change also includes fixes to unit tests that depended on plugin
instances persisting across tests.

Conflicts:

	neutron/tests/base.py
	neutron/tests/unit/ml2/test_mechanism_odl.py
	neutron/tests/unit/test_db_plugin.py

Partial-Bug: #1234857
Change-Id: Ia1f868c2d206eb72ef77d290d054f3c48ab58c94
(cherry picked from commit 6db48dd688d45ba41863926fa1a91d2d3ea484ec)
Make plugin deallocation check optional

The fix for memory leakage in the related bug added a check for plugin
deallocation that performed a call to gc.collect() after every test.
This had the side-effect of increasing test execution time by ~50%, so
this patch makes the check optional via an environment variable
(OS_CHECK_PLUGIN_DEALLOCATION).

It may make sense to create a periodic job that runs with the check
enabled, but otherwise the check can be used by developers for
debugging purposes.

Change-Id: I9ebe663abbc4e4ff3a62d807d5a3230c2ecccd07
Related-Bug: #1234857
(cherry picked from commit ee5c3b0bb60918a7e59e89ceffbafa2f683b74fd)
Added support for NOS version 4.1.0, 5.0.0 and greater

NETCONF temaplates for NOS version greater than 4.1.0 are slightly
different (argh). An init time check of the NOS version is done
to enable selection of the correct NETCONF templates.

Change-Id: I01e82ad402fbbb25d92a99a3325ca2608dd514cb
Closes-bug: #1332719
(cherry picked from commit f807023246501b77e792371d98b612b208f5e8e3)
NSX: Remove unneed call to _ensure_default_security_group

This patch removes an unneeded call to _ensure_default_security_group
which does not need to be called in create_security_group_rule_bulk()
as one would need to call get_security_groups() to look up the uuid
of the default security group which be would created it for us, BOOM!

Change-Id: I628a94c7ea9553dcefa68fa956f25244f0abbb18
Closes-bug: 1340536
(cherry picked from commit e2dac9daf39d9b519df14441bbeb99c3c4a7bfaa)
Merge "Ensure core plugin deallocation after every test" into stable/icehouse
Merge "Make plugin deallocation check optional" into stable/icehouse
Merge "Added support for NOS version 4.1.0, 5.0.0 and greater" into stable/icehouse
Merge "NSX: Remove unneed call to _ensure_default_security_group" into stable/icehouse