Initialise delete_object mock before it is called
Initialise delete_object mock before it is called

Attempt to fix the linked bug by initialising the mock instance for
Connection.delete_object before calling the SwiftService upload
method, so that the delete_object mock already exists before the
delete_segments jobs that run in multiple threads call it.  Otherwise
there is a risk that the delete_segment job threads could race while
creating either the delete_object mock or the
delete_object.return_value mock, resulting in each thread getting a
different instance. That would explain the intermittent test failures
reported in the bug.

Change-Id: Ia82697c093529076b0bbcc6bccd577afdf0839e1
Partial-Bug: #1480223

sohonetlabs/python-swiftclient,jeseem/python-swiftclient,openstack/python-swiftclient,jeseem/python-swiftclient,sohonetlabs/python-swiftclient,ironsmile/python-swiftclient,ironsmile/python-swiftclient,openstack/python-swiftclient,VyacheslavHashov/python-swiftclient,VyacheslavHashov/python-swiftclient