[ORC] De-register eh-frames in the RTDyldObjectLinkingLayer destructor.

This matches the behavior of the legacy layer, which automatically deregistered
frames.
diff --git a/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
index 3344bd4..a92264c 100644
--- a/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
@@ -78,6 +78,12 @@
     ExecutionSession &ES, GetMemoryManagerFunction GetMemoryManager)
     : ObjectLayer(ES), GetMemoryManager(GetMemoryManager) {}
 
+RTDyldObjectLinkingLayer::~RTDyldObjectLinkingLayer() {
+  std::lock_guard<std::mutex> Lock(RTDyldLayerMutex);
+  for (auto &MemMgr : MemMgrs)
+    MemMgr->deregisterEHFrames();
+}
+
 void RTDyldObjectLinkingLayer::emit(MaterializationResponsibility R,
                                     std::unique_ptr<MemoryBuffer> O) {
   assert(O && "Object must not be null");