Ensure that mock.patch.stopall is called last

Fix the way we register mock.patch.stopall as a cleanup so that it is
called last to ensure that we do not then later try to stop any
individual mocks that will have already been stopped.

Change-Id: I50235eb1c8fae3e690fce63b27d18cafdefd8c4c
Partial-Bug: #1365678
Merge "Ensure that mock.patch.stopall is called last"