lavd/avdevice: always free detected devices on error