Release surface on releaseTexImage

The surface set during bindTexImage should be unset during
releaseTexImage. Failing to do so may keep a dangling pointer
to the surface, which can cause a crash later on (this was hit
during the testing of new unit tests which  will be added soon).

Change-Id: Ic258fff8c880d449add825c5e9185435cc4ea419
Reviewed-on: https://swiftshader-review.googlesource.com/17548
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/libGLESv2/Texture.cpp b/src/OpenGL/libGLESv2/Texture.cpp
index 5ab0a8f..364fef8 100644
--- a/src/OpenGL/libGLESv2/Texture.cpp
+++ b/src/OpenGL/libGLESv2/Texture.cpp
@@ -572,6 +572,12 @@
 			image[level] = nullptr;
 		}
 	}
+
+	if(mSurface)
+	{
+		mSurface->setBoundTexture(nullptr);
+		mSurface = nullptr;
+	}
 }
 
 void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)