Avoid uselessly long loop when waiting for hostname

- if we can't ping the admin node, no need to enter the loop anyway
- make the loop shorter