Add detection of getClassLoadingLock method presence to improve performance on JVM >= 7