i965: Implement dma-buf DRI buffer support

This code was shared with i915, but has been split out, so we need to
duplicate the changes.