driver: check shader limits

Add a check for the number of instructions, uniforms, varyings and
temporary registers. This will avoid some crashes.