The generated glDetachShader was not implemented correctly. This patch fixes
the glDetachShader implementation.
GL_INVALID_OPERATION should be generated if program has not been successfully linked.
Implement glDeleteShader. The auto generated code was not handling the errors correctly.