Merge pull request #1660 from billhollings/gpucapturescope-macos125

Apply Apple fix to MTLCaptureScope retention bug to macOS 12.5.