Pass ownership of external encoders to the ACM

We want this because otherwise the ACM uses its mutex to protect an
encoder that's owned by someone else. That someone else may easily
slip up and delete or otherwise touch the encoder before making sure
that the ACM has stopped using it, bypassing the lock.

BUG=webrtc:5028

Review URL: https://codereview.webrtc.org/1702943002

Cr-Commit-Position: refs/heads/master@{#11909}
diff --git a/webrtc/modules/audio_coding/acm2/codec_manager.h b/webrtc/modules/audio_coding/acm2/codec_manager.h
index 660a9c0..fbd3a18 100644
--- a/webrtc/modules/audio_coding/acm2/codec_manager.h
+++ b/webrtc/modules/audio_coding/acm2/codec_manager.h
@@ -41,6 +41,9 @@
   const CodecInst* GetCodecInst() const {
     return send_codec_inst_ ? &*send_codec_inst_ : nullptr;
   }
+
+  void UnsetCodecInst() { send_codec_inst_ = rtc::Optional<CodecInst>(); }
+
   const RentACodec::StackParameters* GetStackParams() const {
     return &codec_stack_params_;
   }