* JENKINS-62006 Check if agent before master, fix remoting classloading error * Use JenkinsJVM API (cherry picked from commit e2837f8a)