Better handling of PATH variable when master and slaves are not using the same platform

PATH variable separators were generated on the master, causing wrong separators to be used when slave and master were not on the same platform. For a Linux master and a Windows slave, / was used instead of \ and : instead of ;

Also catch an NPE on recent jenkins version (at least 1.503). I don't see how to do this better.