Cache info about jar files that might contain Scala classifies.

Deciding wether a class file is produced by Scala is expensive (it entails
parsing the binary). Instead, we cache the information per package fragment,
assuming that a jar contains Scala-only or Java-only classifies.

Fixed #1001999

PS. This commit has been running at a client for a few weeks and proved to solve the problem.