test_iputil.py: repair a test by mocking 'get_local_ip_for'.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
test_iputil.py: use more realistic error for 'command not found' in mock.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
iputil.py: simplify address finding code on cygwin.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>