[release/6.0-rc2] Check if External Object Context is still active after a possible GC (#59436)
* Check if External Object Context is still active after a possible GC
* Update interoplibinterface_comwrappers.cpp
Check if `IsActive()` during consideration too.
* Issues can occur during the multiple managed allocations.
* Add validation of non-null elements in ReleaseObjects() API call. Use detach state instead of IsActive state for EOC.
* Apply suggestions from code review
Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Apply suggestions from code review
Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Review feedback
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>