netutil additions

Adds ListenOnLocalRandomPort and make Localhost more robust.

Change-Id: Ie6dd4318ffe7d72bfa64329fd4d33f898bd7cf0f