If we fail to contruct the Pdf Image Shader, mark the object as busted, and dn't try to remove it from shaders list. Also, when we delete invalid shaders, remove the lock, otherwise we freeze (see CanonicalShadersMutex usage).

R=vandebo@chromium.org

Review URL: https://codereview.chromium.org/19509005

git-svn-id: http://skia.googlecode.com/svn/trunk@10290 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index a0dffb7..8ffafb3 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -444,7 +444,9 @@
 public:
     explicit SkPDFImageShader(SkPDFShader::State* state);
     virtual ~SkPDFImageShader() {
-        RemoveShader(this);
+        if (isValid()) {
+            RemoveShader(this);
+        }
         fResources.unrefAll();
     }