Fix the algorithms for port range calculations

Increased unit test coverage of the functions in portsrange.c and fixed
multiple bugs.

Main changes:
* An empty range is now represented as NULL instead of a range with
first and last port set to 0. This implies that the argument type for
netcat_ports_insert changes from nc_ports_t to nc_ports_t*. It also
implies that the netcat_ports_init function disappears.
* In nc_ports_st, represent the range as [start,end[ instead of
[first,last] which is more natural from a programming perspective.