Make -6 completely optional by using Perl require instead of use.

If the system does not have IO::Socket::INET6 installed then trying
to get an IPv4 free port will fail. By switching to require that
module will only be loaded if the -6 option is used.