if the framebuffer id was not generated by glGenFramebuffers, glBindFramebuffer
needs to create a cached framebuffer.
Fix segfault in glDeleteTextures.
fix segfault in glDeleteRenderbuffers.