Make the is_compatible() and implements() caches more race-safe.