Route all ScalaInstance creations through the cache
Route all ScalaInstance creations through the cache

It was possible to make new classloaders for the scala library and other
jars with each new scala instance. To avoid this, I audited all of the
places within sbt where we make a ScalaInstance and ensure that we
instantiate them in such a way that the classloaders are retrieved
through the state's ClassLoaderCache.

After this change, I found from a heap dump that it was possible to run
test in a project that uses scala 2.12.8 and have only ONE classloader
for the scala library present in the heap dump. With older versions,
there were would be up to 3 or 4 in most heap dumps.

sbt/sbt,sbt/sbt,mdedetrich/sbt,mdedetrich/sbt,sbt/sbt,sbt/sbt,xuwei-k/xsbt,sbt/sbt,mdedetrich/sbt,mdedetrich/sbt,xuwei-k/xsbt,mdedetrich/sbt,mdedetrich/sbt,xuwei-k/xsbt,xuwei-k/xsbt,mdedetrich/sbt,xuwei-k/xsbt,sbt/sbt,sbt/sbt