watcher: put hostname in `hostname` and use IP in ZK path

Commit a1f98ab19cc9d68a79ab4fd20bf79f6d55a0d3b8 did replace the use of
hostname in "hostname" field populated by a joiner by its IP. We
revert this. Also, tests were incorrect in how `ip()` function was
mocked. We also correct this.