Can you try creating a compilation unit that all the OutputArchives share? Something like:
    auto cu = std::make_shared<torch::jit::script::CompilationUnit>();
    torch::serialize::OutputArchive archive(cu);
    {
        torch::serialize::OutputArchive slot(cu);
        module->save(slot);
        archive.write(KEY_MODULE, slot);
    }
    archive.save_to(filename);