threading: Ensure passing the correct retval to decode_frame_exit
We must reload error just before calling dav1d_decode_frame_exit, as it may have become stale between the last load and that call. This can result in crashes since we return a seemingly successfully decoded frame, when it's not.
Reloading it within the frame done condition's body ensures a non-stale value, as we use f->task_thread.task_counter == 0 to ensure all other threads and tasks have already completed when entering it. In other words, only the last thread still working on this frame can execute this code, after all other threads have returned to doing something else.