Fix DeviceSet.replaceDev to first connect to and init the new device,
then perform the replacement