SI-4788/SI-5948 Respect RetentionPolicy of Java annotations

I made `retentionPolicyOf` private, but `isRuntimeVisible` cannot be made private because it is used in `GenASM` and `BCodeHelpers`.