PeerConnection::StartRtcEventLog: Improve callback memory safety

By having a unique_ptr own the callback data instead of a raw pointer,
the compiler helps us ensure that it's destroyed exactly once,
and never used after being destroyed.

(This made the callback object move-only, so I had to add support
for move-only callbacks to rtc::Thread::Invoke().)

BUG=webrtc:8111

Change-Id: Ia0804e4662e63e91e5cee18ecc3f38d2cfe8a26b
Reviewed-on: https://webrtc-review.googlesource.com/10812
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20317}
diff --git a/rtc_base/messagehandler.h b/rtc_base/messagehandler.h
index 9194c1d..ff953f7 100644
--- a/rtc_base/messagehandler.h
+++ b/rtc_base/messagehandler.h
@@ -38,8 +38,8 @@
 template <class ReturnT, class FunctorT>
 class FunctorMessageHandler : public MessageHandler {
  public:
-  explicit FunctorMessageHandler(const FunctorT& functor)
-      : functor_(functor) {}
+  explicit FunctorMessageHandler(FunctorT&& functor)
+      : functor_(std::forward<FunctorT>(functor)) {}
   virtual void OnMessage(Message* msg) {
     result_ = functor_();
   }