Add expire reservations in backport position.

Change-Id: If0e58da50ebe9b50b414737a9bd81d93752506e2
Related-bug: #1348720
(cherry picked from commit f4454f4c6962dd2c57c08dc7fecfcdebe7924e3b)
Add a retry_on_deadlock to reservations_expire

Now that we have an index for the reservations_expire query, we
have uncovered a race with quota usage updates due to the foreign
key on the table, so just retry if there is a deadlock. This is
a fix to unblock the gate while we try to remove the deadlocks
completely.

Change-Id: I1993c3bd1f81facf1d98a4e29f9e8df4858a7d66
Partial-bug: #1350466
(cherry picked from commit 3619c1914e9925e18c062bc11bc3e708137f8322)
Move the error check for "brctl addif"

The git commit 873aad92944f8840e772d65eda4b3320d65a9ce7[1] has moved
"brctl addif" command, but the commit did not move its error check.

Now the error check sees the result of "ip addr show dev <interface>
scope global" command wrongly, and the command outputs "Dump was
interrupted and may be inconsistent" sometimes because of a kernel change.
As the result, gate failures happen sometimes.

This patch moves the error check to right place.

[1]: https://github.com/openstack/nova/commit/873aad92944f8840e772d65eda4b3320d

Change-Id: I92ee96e3aa34f7cd154a8ce4b33852b96cabe8c9
Closes-Bug: #1334142
(cherry picked from commit c250696ba12ead71e741cf8f608ce5212b0cc7bb)
Merge "Add expire reservations in backport position." into stable/icehouse
Merge "Add a retry_on_deadlock to reservations_expire" into stable/icehouse
Merge "Move the error check for "brctl addif"" into stable/icehouse
Merge remote-tracking branch 'upstream/stable/icehouse' into stable/icehouse