modes-slurm.sh: Wait for nodes to actually start before trying to connect
Sometimes, in situations of higher other loads on the cluster, modes-slurm.sh starts and fails to connect to some of the nodes. Presumably they are still starting up. Add a mechanism to only start the master once the nodes have started and are ready (e.g. when they have printed something to stdout).