mesa: optimize display list
Commit 2 and 3 are preparation work for the 4th one which implements primitive merging inside of display list. This is a big perf win in SPECviewperf13 snx test because each display list becomes a single primitive (instead of 3-128 primitives).
The 1st, 4th and 5th commits are small optimizations noticed while testing the other commits.