message: Fix a race condition in RealmCoordinator::clear_cache()
  `realms_to_close` needs to hold strong references to the Realm as otherwise the
  local variable within the critical section can be the last reference to the
  Realm, which leads to a deadlock.
diff: @@ -607,7 +607,7 @@ void RealmCoordinator::unregister_realm(Realm* realm)
  // instances of this type
  void RealmCoordinator::clear_cache() NO_THREAD_SAFETY_ANALYSIS
  {
  - std::vector<WeakRealm> realms_to_close;
  + std::vector<std::shared_ptr<Realm>> realms_to_close;
  {
  std::lock_guard<std::mutex> lock(s_coordinator_mutex);
  @@ -633,12 +633,9 @@ void RealmCoordinator::clear_cache() NO_THREAD_SAFETY_ANALYSIS
  // Close all of the previously cached Realms. This can't be done while
  // s_coordinator_mutex is held as it may try to re-lock it.
  - for (auto& weak_realm : realms_to_close) {
  - if (auto realm = weak_realm.lock()) {
  + for (auto& realm : realms_to_close)
  realm->close();
  }
  - }
  -}
  void RealmCoordinator::clear_all_caches()
  {
  