implement ROS_IP=localhost behavior for roscpp, and for outbound rospy connections

The wiki doc for ROS_IP:  http://wiki.ros.org/ROS/EnvironmentVariables    says that setting ROS_IP=localhost will "prevent remote components from being able to talk to your local component." This can be useful in some settings. However, this behavior was previously only implemented for inbound rospy topic connections and services. This pull request implements it for inbound and outbound roscpp connections, and for outbound rospy connections.
What about the case where we're asked to connect to a node via one of our own non-loopback IP addresses?  E.g., we're in `'localhost'` mode and we hear about a publisher at `'192.168.1.100'`, which is our own address?  That connection should be allowed.  I think that we need to iterate over all of our own IP addresses, plus our hostname (maybe fully-qualified and not?), plus the special cases of `'localhost'`, `'127.*'`, etc.  Basically, we need to match on any host/address string that legitimately matches our machine.