Man page improvements

Include the descriptions of the connect and listen modes (which are
included in the info pages) into the man page as well.
Add some unit tests for the portsrange code

Note that none of them passes, showing that the code is badly broken.
Improve encapsulation of modules

The problem: I want to write a unit test for the functions in
portsrange.c. If the project is configured with --enable-debug, then the
code in portsrange.c depends on the ncprint and debug_fmt functions
which are defined in misc.c. However, misc.c depends on stuff in
netcat.c. On the other hand, netcat.o can't be linked into the unit test
executable because it contains the main function.

The solution: Move the ncprint and debug_fmt functions to a separate
file (ncprint.c) and ensure that it is completely self-contained. In
that case, it is enough to link ncprint.o together with portsrange.o
into the test executable.

Required changes:
* Rename misc.h to ncprint.h (mish.h only contained stuff relevant for
the two functions moved to ncprint.c).
* Make opt_debug and opt_verbose static variables in ncprint.c and
define new functions to set them.
Fix an incorrect portsrange test case
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.
Add missing license headers
Merge branch 'check'
Move the fix_ling variable to the right scope
Fix a compilation failure that occurs when DEBUG is undefined
Don't set SO_LINGER

* Add a test case (exec-with-close-after-write.py) that shows that
setting SO_LINGER is problematic if the connection is closed right after
writing data.
* Comment out the code that sets SO_LINGER. We will decide later what to
do with that code.
Reject connections from remote ports not in the specified range

* Add a test case (remote-port-range.py) that tests this scenario.
* Fix the code responsible for checking the port range.
* Ensure that rejected connections are closed using RST instead of FIN
so that the client gets a connection reset error.
Remove the unused flagset code
Remove the SO_LINGER stuff

* SO_LINGER causes issues when closing the connection just after sending
data (the peer will get a connection reset error instead of receiving
the data).
* Since we also set SO_REUSEADDR, there is no risk that TCP ports will
be blocked by existing connections in state TIME_WAIT (This appears to
be the original motivation for setting SO_LINGER).
Merge branch 'master' into zosunix

Conflicts:
	src/flagset.c
	src/network.c