Fix accessing nested-dir scripts from nested-dir agent templates.

This works the following way: if path to agent template is,
e.g. <someHash>/template/agent/SqlServerCluster/FailoverCluster.template,
and it references script file '/ImportCoreFunctions.ps1', then it will
be searched in '<someHash>/template/agent/scripts/' dir, but if it
references 'Failover-Cluster.ps1', it will be searched in
'<someHash>/template/agent/scripts/SqlServerCluster/' dir.

So the root-like agent dir '<someHash>/template/agent' corresponds to
root-like scripts dir '<someHash>/template/agent/scripts', and the
actual script file will be searched immediately in root-like scripts
dir if it starts with '/' (absolute name), or there will be
'rest-dirs' between root-like scripts dir and the script filename if
the script filename is a relative one. 'rest-dirs' is the difference
between root-like agent dir and the actual parent dir of the agent
template which references the script dir. As you see, the
abovementioned example is much clearer than the explanation.

Change-Id: I59b1a253a5c9c9d0f96bd8dd702b7f35a6f6ff81
Closes-bug: #1271578
Merge "Fix accessing nested-dir scripts from nested-dir agent templates." into release-0.4