shader_api: Fix bounds checking of glUniform and glUniformMatrix