ui/gtk: Create a common release_dmabuf helper