Fix a bug in SurfaceTexture::dequeueBuffer.

This change fixes a bug that allowed the most recently queued buffer to
be returned by dequeueBuffer.  At the next updateTexImage call, the
dequeued buffer would be set as the contents of the texture even though
the client could be writing to it.

Change-Id: I53dc14eed13262475627d5551337df57fd78fe00
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 28f3dc2..1389ed6 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -131,7 +131,7 @@
     Mutex::Autolock lock(mMutex);
     int found = INVALID_BUFFER_SLOT;
     for (int i = 0; i < mBufferCount; i++) {
-        if (!mSlots[i].mOwnedByClient && i != mCurrentTexture) {
+        if (!mSlots[i].mOwnedByClient && i != mCurrentTexture && i != mLastQueued) {
             mSlots[i].mOwnedByClient = true;
             found = i;
             break;