Fix #805 by resetting selected device on failure
It can happen that devices can be selected but not used
(permissions problems, connection issues, driver issues, etc.),
so in those cases we want to fail gracefully instead of
segfaulting.
The reason for the segfault is the device selector button
isn't reset in case the device couldn't be opened, causing
the rest of the application to try and work with a device
instance that is actually invalid.
Resetting the device selector when the device failed to
open not only fixes this but also makes the UI more
consistent with the internal state.