input: decoder: fix use-after-free
Audio latency callback is using the fifo lock, which cannot be released until the audio output is destroyed. In general, outputs can use the fifo, and we need to release/detach them from the input decoder before freeing the lock.
Extracted from !2144 (merged)