Protect against hash attacks

Moved from GitHub ristretto/131

Posted by martinmr:

An attacker can prevent new items from being accepted by the policy by artificially raising the frequency of the victim.

Caffeine code: https://github.com/ben-manes/caffeine/blob/8bdfb0d95db523d15c2560f05a228468ecdbe98d/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java#L752-L776