ws: Handle the case where hostnamed is not active or available

This is code path should be resilient to the hostnamed service
not running. In addition, allows us to test in places where
no systemd is running.