Fix traceback in get_local_device_ip_address

Even though successful in finding the local device IP address, closing the
pipe while not having read it to end of file could still generate an error
when closing.  We now wrap the successful-path close in a catch.