lavapipe: skip "pipeline barriers" if they're first or last in a cmdbuf
barriers just trigger a full flush, which is unnecessary if it's:
- the first cmd in a cmdbuf, as the previous cmdbuf will have already flushed and so this is flushing nothing
- the last cmd in a cmdbuf, as there will be a flush immediately after returning from this function