Don't rely blindly on the keys 'alt_device' and 'device_uuid'.

This will cause failures on systems not providing these keys such as
FreeBSD.