iputil.py: fix an error handling bug. refs #1381

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
iputil.py: add tests for recent changes. refs #1381, #1988, #982, #1064, #1536, #1935, #898, #1707, #1918

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
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>
test_iputil.py: repair a test for cygwin (which is intended to behave differently).

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
test_iputil.py: fix and improve tests on Windows.
Test all platform variants (Unix, Windows, Cygwin) on each platform.

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