Unlike OpenGL and Metal, this handle is not shared, but rather Cycles has to take ownership of it. This required a fair amount of refactoring to ensure the handle is closed, ownership is properly transferred, and the handle is recreated once when the pixel buffer is modified.