decoder_thread: Fix error handling