Backport of "gl/macos: a couple of race/reference count fixes" into 1.24
Backport of !6504 (merged) "gl/macos: a couple of race/reference count fixes".
Commits:
- 49a7424d gl/context/cocoa: ensure pixel format lives as long as the context
- 3c5bb4bf glbufferpool: protect release_buffer from multiple concurrent access
- d9b563e9 glimagesink: unref the potential last ref outside of the glimagesink lock
- 3f29c897 glimagesink: avoid a possible critical on shutdown
- b080d01b glwindow/cocoa: keep a window reference across an async callback
- 2a02107c glcaopengllayer: NULL some fields when freed