Fix race when running initialize_gateway_device()

If multiple calls that result in initialize_gateway_device() being
run occur at roughly the same time then there is a race between the
ip route commands being run at the same time. This will cause
instances to go into an error state. This commit adds a global lock
to the initialize_gateway_device() method to prevent it from being
run at the same time to avoid this issue.

The race condition is not directly testable in unit tests because it
requires a multithreaded environment to run
initialize_gateway_device() at the same time. It was uncovered
with tempest in parallel.

Fixes bug 1217163

Change-Id: Ib750381636d1341062928d0abc8d3518e327935e
Merge "Fix race when running initialize_gateway_device()"