[FIXED JENKINS-25635,JENKINS-25226] - Variables substitution issues

The fix addresses two major bugs discovered in perforce-1.3.28
This hack should break at some point.
Curiously, SCM step succeeds in such case o_O