discover/device-handler: Fix use-after-free when unmounting