Investigate strong references after SDK close
Description
During development I noticed that when closing the SDK using the Close SDK button in the iOS sample app, there are still strong references internally which are not cleaned up properly.
This was noticed by the following warning, which is also user-facing:
This is actually caused by session replay not cleaning up the background processing, with the scope being already discarded, causing it to create and configure a new scope, which then accesses the UIWindow from the background thread.
https://github.com/getsentry/sentry-cocoa/blob/603fec8f5dcd6e209a79e2dfa4f7089f01cc5d20/Sources/Sentry/SentryCrashWrapper.m#L187-L194
Furthermore the memory graph after the close still shows a lot of non-deallocated instances of the SDK:
An initial investigation has show that some of these references might actually be false positives as the dependency container gets recreated in reset rather than deallocated.
In addition I did find classes which have their own singleton, are not deallocated when calling SentrySDK.close(), e.g. the SentryGlobalEventProcessor. This will require refactoring to move them to the dependency container.