GROOVY-6962: Fix IllegalAccessException if the target public method belongs to a package private class