gallium/pb_cache: check parameters that are more likely to fail first