netutil additions

Adds ListenOnLocalRandomPort and make Localhost more robust.

Change-Id: Id6416f7ae5c35fb247035ecb0021f3978ff3480e
netutil refactor

Change-Id: I7383147a36758de6fd8e5b66e0d6d15b70be054a