Improve rest_transport_uri default value.

If not set, use the value of rest_listen_uri. Add exception if
rest_listen_uri is 0.0.0.0 to use the first non-loopback IPv4 address.

This is a fix for #557. (Using a new pull request because I accidentally created a pull request against the 0.20 branch.)