fix: retain camera CVPixelBuffer + throttle GC on iOS (v4.15.1)
Two iOS-side fixes for use-after-free crashes (kima downstream + sample
app on iPad/iPhone 17 Pro) and the resulting cpu_resource warnings.
* CameraController.captureOutput now CFRetains the CVImageBufferRef
synchronously on the camera output queue before dispatch_async, with
a matching CFRelease in the worker's finally block (and an outer
bufferEnqueued guard for the dispatch-failed path). Without this the
K/N closure dereferenced freed memory inside FrameProcessor's first
CFRetain because AVCaptureVideoDataOutput recycles sample buffers
the moment the delegate returns.
* The dispatch_async closure no longer captures any per-frame ObjC
reference. Orientation and mirrored flag are snapshotted into local
primitives, lastCaptureConnection is written directly on the camera
output queue (idempotent — connection is constant for the session),
and analyseBufferForAll is invoked with captureConnection = null
since both overrides are non-null.
* GC.collect() is now called every 10 frames (~3 Hz at 30 fps) instead
of every frame. K/N's auto-GC trigger is too lazy at this allocation
rate so a periodic synchronous collect is still required, but cutting
the frequency 10× clears the sustained CPU advisory iOS 26 was
raising on the camera queue.