Do not use blk_manager if the device is already in dom0, try to detach device only when it was mounted (otherwise it was detached already in error handling code).