If the revision id is null, the item should not be cachable.
However, you still need a poolcounter work key for such cases,
and this method was used for both. This is confusing and seems
dangerous, so split into two methods, one where a revision id
is required, and another one where it is optional that should
only be used when it is not for a cache key.
This also fixes a warning about null revId on php 8.1 in tests.
Bug: T313663
Change-Id: Id685caeecf21d058bfd8446d9b5e21f0f11e0177