main: Add utility function _mesa_lookup_bufferobj_err.