xenapi: enable attach volumes to non-running VM

Similar to when detaching a volume, ensure we only attempt to
plug a VBD when the server is running, otherwise it will fail.
This also fixes up the existing unit test that was not working.

Fixes bug 1199477
Change-Id: I32d85ca09849b63b815cc3daba3bb02c31d92e8d
Merge "xenapi: enable attach volumes to non-running VM"