Fix leaks in CGImageDestination creation. Fixes #13671.