message: add test to ensure compact function isn't invoked
  when the realm is already open on another thread
diff: @@ -1117,7 +1117,9 @@ TEST_CASE("SharedRealm: compact on launch") {
  {"value", PropertyType::String}
  }},
  };
  + REQUIRE(num_opens == 0);
  auto r = Realm::get_shared_realm(config);
  + REQUIRE(num_opens == 1);
  r->begin_transaction();
  auto table = r->read_group().get_table("class_object");
  size_t count = 1000;
  @@ -1128,12 +1130,15 @@ TEST_CASE("SharedRealm: compact on launch") {
  REQUIRE(table->size() == count);
  r->close();
  + SECTION("compact reduces the file size") {
  // Confirm expected sizes before and after opening the Realm
  size_t size_before = size_t(File(config.path).get_size());
  r = Realm::get_shared_realm(config);
  + REQUIRE(num_opens == 2);
  r->close();
  REQUIRE(size_t(File(config.path).get_size()) == size_before); // File size after returning false
  r = Realm::get_shared_realm(config);
  + REQUIRE(num_opens == 3);
  REQUIRE(size_t(File(config.path).get_size()) < size_before); // File size after returning true
  // Validate that the file still contains what it should
  @@ -1142,6 +1147,24 @@ TEST_CASE("SharedRealm: compact on launch") {
  // Registering for a collection notification shouldn't crash when compact on launch is used.
  Results results(r, *r->read_group().get_table("class_object"));
  results.async([](std::exception_ptr) { });
  + r->close();
  + }
  +
  + SECTION("compact function does not get invoked if realm is open on another thread") {
  + // Confirm expected sizes before and after opening the Realm
  + size_t size_before = size_t(File(config.path).get_size());
  + r = Realm::get_shared_realm(config);
  + REQUIRE(num_opens == 2);
  + std::thread([&]{
  + auto r2 = Realm::get_shared_realm(config);
  + REQUIRE(num_opens == 2);
  + }).join();
  + r->close();
  + std::thread([&]{
  + auto r3 = Realm::get_shared_realm(config);
  + REQUIRE(num_opens == 3);
  + }).join();
  + }
  }
  #endif
  