device: Fix race condition when clients vanish
If a client vanishes while we are opening or closing then fprintd would uncoditionally try to close the device immediately. This should not be done, it instead needs to wait for the open/close to complete.
Add open/close to the current action enum and keep track of the fact that they are ongoing. Also check, whether the device has been closed in the meantime (after the nested mainloop is done).
Fixes: #65 (closed)