mesa: fix error handling for glSelectBuffer