[M40 merge] Detect discarded SkPictureShader pixel refs.

This doesn't address the more general problem, but reduces the race
window significantly.

(merge of 387a01a6357b4ba6ff87ac57626de1cb6a3b31bf)

BUG=440282
TBR=reed@google.com
NOTRY=true

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