Fix self assigment in GrResourceKey

TBR=robertphillips@google.com

BUG=skia:3340

Review URL: https://codereview.chromium.org/866263007
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index d500a65..15d7b43 100644
--- a/include/gpu/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -49,10 +49,12 @@
     }
 
     GrResourceKey& operator=(const GrResourceKey& that) {
-        size_t bytes = that.size();
-        SkASSERT(SkIsAlign4(bytes));
-        fKey.reset(SkToInt(bytes / sizeof(uint32_t)));
-        memcpy(fKey.get(), that.fKey.get(), bytes);
+        if (this != &that) {
+            size_t bytes = that.size();
+            SkASSERT(SkIsAlign4(bytes));
+            fKey.reset(SkToInt(bytes / sizeof(uint32_t)));
+            memcpy(fKey.get(), that.fKey.get(), bytes);
+        }
         return *this;
     }