Issue #121: amended free_device with device check as in Factory::disconnect
Issue #121: amended free_device with device check as in Factory::disconnect

gift-surg/GIFT-Grab,gift-surg/GIFT-Grab,gift-surg/GIFT-Grab,gift-surg/GIFT-Grab