Remove trailing junk from IP addresses for sockets

Summary: If IP addresses contain an additional '/' (potentially followed by other
characters) they should all be ignored. For instance prot://1.2.3.4:567/foo
is a connection to 1.2.3.4 on port 567 over protocol prot where /foo is
simply ignored.

Fixes #3154

Reviewed By: @JoelMarcey

Differential Revision: D1671652

Signature: t1:1671652:1415769458:5fd487f565ec5f3c4a801270b9857f8174c89070