message: Fix a destruction ordering issue with custom devices and the TFE_Context
  Previously the context was deleting some objects before custom devices had a chance to release their references. This change just moves custom device destruction to be a bit earlier.
diff: @@ -511,6 +511,10 @@ EagerContext::~EagerContext() {
  // don't send RPCs and block in destructor.
  WaitForAndCloseRemoteContexts();
  + // Custom devices may have obtained references to various context components
  + // (executors, thread pool). It's safer to run their destructors early.
  + custom_devices_.clear();
  +
  ClearCachesAndThreadExecutors();
  for (auto& entry : registered_functions_) {
  while (!entry.second->Unref()) {
  