[FIXED JENKINS-19557] - Improved MacroStringHelper in order to avoid sub...

Fix allows to avoid substitution errors in logs during buildEnv() and improves performance of the job.

Resolves https://issues.jenkins-ci.org/browse/JENKINS-19557
Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>