Fix KT-4168 use proper buildscript classpath

Consider multi-project Gradle build.
If the kotlin plugin is applied in a subproject while buildscript is configured in a parent project, we failed to correctly resolve plugin core dependency.
With this patch, wrapper will carefully select ScriptHandler that was used to add dependency on wrapper itself (and has required repositories configured). This script handler will be used for resolving other dependencies used by kotlin (plugin core, jdk annotations etc.)