Connecting and binding to 127.0.0.1 in tests

Instead of Socket.gethostname and localhost, the former doesn't seem to resolve right in Travis.