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

During master restart only attempt to reconnect the slave after the master has
finished restarting.

This uses changes pushed into remoting 2.45.

This is the same as a previous pull request but has been rebased now that the pom references remoting 2.48 via another changeset.