message: Don't attempt to compact on launch if we're opening a Realm file without
  a `Realm` instance.
  We need a `Realm` instance in order to perform the compaction, and we
  likely don't care to perform a compaction if it's not being opened as
  part of creating a `Realm` instance.
diff: @@ -161,7 +161,7 @@ void Realm::open_with_config(const Config& config,
  };
  shared_group = std::make_unique<SharedGroup>(*history, options);
  - if (config.should_compact_on_launch_function) {
  + if (realm && config.should_compact_on_launch_function) {
  size_t free_space = -1;
  size_t used_space = -1;
  // getting stats requires committing a write transaction beforehand.
  