[JENKINS-23007] Use environment of the node that polls

Jenkins cannot provide the environment of an offline node because
it throws while building the JDK path. So the last built node can't
be used for this. Instead, use the polling node's environment.

While this might still have unexpected results, it seems to be a
saner approach compared to building up the environment from
Jenkins.getGlobalNodeProperties()/AbstractProject.getEnvironment(...).