factor out SkLRU::insert_or_update()

I keep forgetting that insert() breaks if there's
an existing item with that key, so assert there's
not and factor out a safer insert_or_update().

Change-Id: I5d7e3b163d651442d309b7486f8d21e64497a6a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377537
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2 files changed