Support IPv6 lookup in bitcoin-cli even when IPv6 only bound on localhost

First query in the current way (intelligently determining which network
has a non-localhost interface). If this does not succeed, try plain
lookup.

Needed for testing.

Fixes #1827 by always allowing IPv6 to be used.
Add Python test for -rpcbind and -rpcallowip

Add a new test, `rpcbind_test.py`, that extensively tests the new
`-rpcbind` functionality.