Open a device. Fails with invalid argument when the device is not a V4L2 device.
Perform an action with a device.
The device will be close on exit from withDevice, whether by
normal termination or by raising an exception. If closing the
device raises an exception, then this exception will be raised by
withDevice rather than any exception raised by the action.