[DF-185] Fixed issue with order of releaseing OpenGL context on MacOS