Add resolveBindIP utilty function and test.

Not called anywhere currently. Might be used in the future to implement
a --bindIP flag that would constrain which local IP address is used when
dialing and listening.