Finish the recording when the last frame has arrived
Instead of promptly stopping the producing thread, wait for the pipewire stream to mark itself as stopped after we've asked it to deactivate. This way we don't forget to process the last frames of the stream.