Beah should work when kernel has ipv6.disable=1

Bug: 1062896
handle any combination of IPv6 and IPv4 being enabled

Extracted helper functions for connecting and listening to loopback
using IPv4 or IPv6.

Bug: 1059479
Change-Id: I4ebaa8f520c741e6c3d2412a3ecf52fdd4000ff5
Merge changes I4ebaa8f5,I329e78ea into develop

* changes:
  handle any combination of IPv6 and IPv4 being enabled
  Beah should work when kernel has ipv6.disable=1