xenapi: workaround for failing vbd detach

Sometimes xapi returns with an internal error during unplug_vbd. This
patch adds a workaround for XenServer 6.2 by inspecting the error
message, and retry the unplug.

In addition, this also ensures that sleep is no longer called after the
last retry before raising an exception.

Fixes bug 1217972
Change-Id: I7b86325714e38b00a2f51bbf083b5532a6c51fa9
Merge "xenapi: workaround for failing vbd detach"