Unlink death recipient which references to DisplayContent

Though the remote side (SystemUI) will unregister the recipient
when receiving display removed, it may be too late that the
DisplayContent is removed from RootWindowContainer, then WMS#
setDisplayWindowInsetsController becomes no-op and causes the
instance of DisplayContent to be leaked.

Also release windowing layer manually in case it is an additional
layer which isn't managed by WindowContainer (e.g. if the display
does not have FEATURE_WINDOWED_MAGNIFICATION). So it won't rely
on GC to release.

Bug: 240704591
Test: Create/destroy virtual display many times.
      GC: adb shell 'kill -10 `pidof system_server`'
      No surface of virtual display exists in:
      adb shell dumpsys SurfaceFlinger grep -A 100 'Offscreen'
Change-Id: Iac84992b8eb13c4348dfca87924fb0c2fa94a5b8
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 5ac8bd7..09e5cc6 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -3176,8 +3176,12 @@
             if (DEBUG_DISPLAY) Slog.v(TAG_WM, "Removing display=" + this);
             mPointerEventDispatcher.dispose();
             setRotationAnimation(null);
+            // Unlink death from remote to clear the reference from binder -> mRemoteInsetsDeath
+            // -> this DisplayContent.
+            setRemoteInsetsController(null);
             mWmService.mAnimator.removeDisplayLocked(mDisplayId);
             mOverlayLayer.release();
+            mWindowingLayer.release();
             mInputMonitor.onDisplayRemoved();
             mWmService.mDisplayNotificationController.dispatchDisplayRemoved(this);
             mWmService.mAccessibilityController.onDisplayRemoved(mDisplayId);