Handle oneshot devices correctly

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>