Wait for device to be attached.