frame_thread_encoder: make 'exit' member atomic