xenapi: refactor detach volume

Share more code between detach and detach_all, and make it easier to
read. At the same time, improve the test coverage.

When introducing the new tests, I created a common test base class,
VolumeOpsTestBase that matches VMOpsTestBase.

Change-Id: I7c9d677e7b589b525e2c6ebc43ef81a64a57511d
Merge "xenapi: refactor detach volume"