title: Crash when calling CGImageDestinationFinalize with large photo
body: <p>In the code below I am crashing on the CGImageDestinationFinalize() line. The CGImage is a large JPG photo. It works fine if I use a smaller JPG. But anything over 10MB crashes on the device with "out of memory". </p>
  
  <p>I think the CGImageDestination* methods are streaming the write but I must be doing something wrong that is retaining the data.</p>
  
  <p>Is there another API call I should use when writing large JPGs?</p>
  
  <pre><code>BOOL SKImageWriteToDisk(CGImageRef image, NSURL *url, SKImageProfile profile, CGFloat dpi)
  {
      CFStringRef type = profile == SKmageProfileCompressed ? kUTTypeJPEG : kUTTypePNG;
      CGImageDestinationRef destination = CGImageDestinationCreateWithURL((__bridge CFURLRef)url, type, 1, NULL);
      if (!destination) {
          return NO;
      }
  
      NSMutableDictionary *properties =
      [@{
          (id) kCGImagePropertyDPIHeight: @(dpi),
          (id) kCGImagePropertyDPIWidth: @(dpi)
      } mutableCopy];
      if (profile == SKImageProfileCompressed) {
          properties[(id) kCGImageDestinationLossyCompressionQuality] = @(0.8f);
      }
      CGImageDestinationAddImage(destination, image, (__bridge CFDictionaryRef)properties);
      BOOL finalizeSuccess = CGImageDestinationFinalize(destination); // crash!
      CFRelease(destination);
      return finalizeSuccess;
  }
  </code></pre>