Make Android/iOS local/remote description accessors thread safe.

Since the descriptions can be modified on the signaling thread,
ToString can only be safely called on that thread.

Bug: webrtc:11791
Change-Id: Icf6aada8aa66d00be94c6bda7b22e41b5d3bbc17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180541
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31862}
diff --git a/api/proxy.h b/api/proxy.h
index b1ebe31..0e5d622 100644
--- a/api/proxy.h
+++ b/api/proxy.h
@@ -400,11 +400,13 @@
 // For use when returning purely const state (set during construction).
 // Use with caution. This method should only be used when the return value will
 // always be the same.
-#define BYPASS_PROXY_CONSTMETHOD0(r, method)                            \
-  r method() const override {                                           \
-    static_assert(!std::is_pointer<r>::value, "Type is a pointer");     \
-    static_assert(!std::is_reference<r>::value, "Type is a reference"); \
-    return c_->method();                                                \
+#define BYPASS_PROXY_CONSTMETHOD0(r, method)                                \
+  r method() const override {                                               \
+    static_assert(                                                          \
+        std::is_same<r, rtc::Thread*>::value || !std::is_pointer<r>::value, \
+        "Type is a pointer");                                               \
+    static_assert(!std::is_reference<r>::value, "Type is a reference");     \
+    return c_->method();                                                    \
   }
 
 }  // namespace webrtc