Following Chris' review, here is an updated patch using drmMMListHead.
I did a quick read of the benchmarks/tests files in igt, as far as I can see, drm_intel_bufmgr_destroy() is always called before the drm file descriptor is closed. So it seems this change shouldn't break anything.
Cheers,
- Lionel