[FIXES JENKINS-24272] jnlp slaves fail to reconnect when master is restarted

During master restart only attempt to reconnect the slave after the master has
finished restarting.
Merge pull request #1479 from oldelvet/jenkins-24272-v4

[FIXES JENKINS-24272] jnlp slaves fail to reconnect when master restart