Add specs for some stuff in Rex::Socket
Refactor `getaddress` in terms of `getaddresses`
Better docs, more accurate var names
Replace unused var with purpose-revealing comment
Use 'unless' instead of 'if not'
Land #2855, Rex::Socket refactor and specs