ui/cocoa: Add format check for shared surfaces

While looking how to fix display problems with bpp=16 in QEMU on OS X, I stumbled across your vga-work branch. Previously, the code always tried to share surfaces for bpp=16, but Cocoa on OS X only supports x1r5g5b5 instead of the expected r5g6b5. I am aware this isn't QEMU upstream, but the format check you already implemented is exactly what I needed.