Instead of glGetProgamiv we should save link_status in glLinkProgram
 if program is null we need to thrown GL_INVALID_OPERATION