[FIXED JENKINS-7411]

Environment variables are in fact not used at all during expansions.
This commit fixes that. As discussed in the ticket, and as done
elsewhere, the standard convention is to use previous build's
environment to expand polling.

Also see JENKINS-19042