Write cache unless there *is* a cache hit:

Moves writeCache call back to hooks (changed in 9ba4ef269d9ea1adc016cbc83e58aef1be45b6f9)
 and makes it unconditional, so only one part of the code decides
whether to write to the cache.

Bug: 45973
Change-Id: I6b387795304ff15c960fcf0f5354a9ac939e1212