Fix nullptr deref in cache lookup

An inner function was taking a ptr where almost everything
calling took a ref. All the ref's were ok, but the test was
still passing in a nullptr. Fix API and test.

Change-Id: I5bcb93f52fc1c58f7bb135b5891223ed863eaede
Reviewed-on: https://skia-review.googlesource.com/154860
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
3 files changed